neojquery
2010-02-04 15:21:43 UTC
Hi
I am using the Forms plugin to do an Ajax submit , and I have two button on
the page I need to know which one has been clicked and trigger an event
based on this. I am not sure how to do this, this event shouldnt stop the
form posting or anything but just need to know which one is clicked.
Some code
$(this).ajaxSubmit({
dataType: 'json',
resetForm: false,
beforeSubmit: function(formData, form, opts) {
$('input[type=submit], input[type=image]', this).attr('disabled',
'disabled');
},
success: function(json) {
$('input[type=submit], input[type=image]', this).removeAttr('disabled');
$('#form').submit();
}
}
});
I am using the Forms plugin to do an Ajax submit , and I have two button on
the page I need to know which one has been clicked and trigger an event
based on this. I am not sure how to do this, this event shouldnt stop the
form posting or anything but just need to know which one is clicked.
Some code
$(this).ajaxSubmit({
dataType: 'json',
resetForm: false,
beforeSubmit: function(formData, form, opts) {
$('input[type=submit], input[type=image]', this).attr('disabled',
'disabled');
},
success: function(json) {
$('input[type=submit], input[type=image]', this).removeAttr('disabled');
$('#form').submit();
}
}
});
--
View this message in context: http://old.nabble.com/Forms-Plugin---Button-Id-tp27452251s27240p27452251.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.
View this message in context: http://old.nabble.com/Forms-Plugin---Button-Id-tp27452251s27240p27452251.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.