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

Rispondi quotando
