Visualizzazione dei risultati da 1 a 4 su 4

Discussione: Mootools form e ajax

  1. #1

    Mootools form e ajax

    Ciao vorrei richiamare una pagina php per inviare dei dati da salvare in un database mysql, il tutto tramite ajax e l'uso di mootools 1.11 per sfruttare questa tecnologia.

    Ecco il codice js usato:

    currentNote.onsave = function (note)
    {
    var r = currentNote.rect;
    $('left').value = r.left;
    $('top').value = r.top;
    $('width').value = r.width;
    $('height').value = r.height;
    $('text').value = currentNote.text;


    $('tag_photo').addEvent('submit', function(e) {
    /**
    * Prevent the submit event
    */
    new Event(e).stop();

    /**
    * send takes care of encoding and returns the Ajax instance.
    * onComplete removes the spinner from the log.
    */
    $('tag_photo').send();
    });


    Ed ecco il form:

    <form name="tag_photo" id="tag_photo" method="post" action="submit_data.php">
    <input type="hidden" name="uid" id="uid" value="<?php echo $my->id; ?>" />
    <input type="hidden" name="left" id="left" value="" />
    <input type="hidden" name="top" id="top" value="" />
    <input type="hidden" name="width" id="width" value="" />
    <input type="hidden" name="height" id="height" value="" />
    <input type="hidden" name="text" id="text" value="" />
    </form>

    Il problema è che anche se spingo nel bottone che esegue questo script, la pagina submit_data.php non viene richiamata.... qualcuno può aiutarmi??? grazie

  2. #2
    scusa, ma che cos'è currentNote?

  3. #3
    è la funzione che ho creato per salvare quando la invoco, però non mi esegue l'action della form...

  4. #4
    scusa, ma se invii send() senza argomenti lui cosa dovrebbe fare?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.