Creating a form dynamically
- by Nathan
Hi,
I use a search button that creates a form dynamically at the server side and returns it with Jquery syntax.
After I fill-up the form and click on submit button, there is another .submit() Jquery function that suppose to be called to validate input before data is sent to the server.
But, for some reason, this function is never called, and the data is request is sent.
In more details:
This is the form that the serach button creates dynamically at the server side and "prints" to html page with Jquery:
<form action=... name="stockbuyform" class="stockbuyform" method="post">
<input type=text value="Insert purchasing amount">
<input type="submit" value="Click to purchase">
</form>
And here is the .submit() function :
$(".stockbuyform").submit(function() {
alert("Need to validate purchasing details");
}
But whaen I click on purchase button, the .submit() function is never called.
Does it mean that I can't use another Jquery call with the answer I got in the first call?