Friday, 16 August 2013

problems in checking the form input values before submitting using JQUERY

problems in checking the form input values before submitting using JQUERY

my code is as follows
$(document).ready(function() {
// this is a button to add the form to the DOM tree.
$("#submitPara").click(function() {
$("body").append('<form id = "dimensionAndObjects" action =
"#"></form>');
some code to add some input fields, omitted...
$('#dimensionAndObjects').append('<p><input id = "submitDO" type =
"submit" value = "submit"></input></p>');
return true;
});
$('#dimensionAndObjects').submit(function() {
alert("haahhhahhaha");
return false;
});
});
it seems that the submit function doesn't work because the alert info
doesn't appear. if i put the submit function inside the click function, it
doesn't work either. what's wrong? I am a totally freshman to jQuery,
thanks in Advance!

No comments:

Post a Comment