On an asp.net page, I used the jQuery Form wizard from http://www.thecodemine.org, and now that I have (almost) everything configured properly, I'm having the problem of not knowing how to handle the submit event.
I'm new to jQuery/AJAX and the last time work had me working on asp.net pages was a few years back.
Here's the script tag defining the form parameters in the page:
<script type="text/javascript" language="javascript">
$(function() {
$("#RegistrationFormEn").formwizard({
formPluginEnabled: true,
validationEnabled: true,
focusFirstInput: true
},
{
messages: { email: "Invalid email (custom message)"}
},
{
success: function(data) {
$("#status").fadeTo(500, 1, function() { $(this).html("You are now registered!").fadeTo(5000, 0); })
},
dataType: 'json',
resetForm: true,
textSubmit: 'Register'
}
);
});
</script>
and the code in my js file:
$(document).ready(function() {
$("#VisaHelpNeeded").click(function() {
$("#VisaAttach").fadeIn()
});
$("#VisaHelpNotNeeded").click(function() {
$("#VisaAttach").fadeOut()
});
$("#VisaIsRequired").click(function() {
$("#VisaJorEmbassy").fadeIn()
});
$("#VisaIsNotRequired").click(function() {
$("#VisaJorEmbassy").fadeOut()
});
$().ajaxStart(function() {
alert(this === document);
alert('caught the ajax!');
});
$().ajaxForm(function() {
processJson(this.data);
});
$().submit.click(function() {
alert('caught the submit');
});
});
You can see that the last few methods were just traps to see which method gets fired. I'm baffled to see that none of them apparently caught the submit.
Now one question is how to handle the submit event? Because the next step is to try and have the data sent to a webservice that would then pipe everything into a DB and send an email (I have no problem with the webservice, its catching the submit that's giving me a hassle).
All help is very much appreciated, so a very big thank you in advance.