[jQuery] Re: submit a form with a link
Hi, my english is not good enough, I hope I can explain it to you!!! I`m using this to validate: $(document).ready(function() { var validator = $("#form1").bind("invalid-form.validate", function() { $("#summary").html(""+ ""+ ""); }).validate({ rules: { errorContainer: $("#summary"), input1: "required", input2: "required", input3: "required" } }); }); I have the submit button to validate that the 3 inputs are complete and redirect to page1.jsp, and the submit link that checks that only input1 is complete to opens a pop-up window. Thank! Sole.
[jQuery] Re: submit a form with a link
> I have a form with 3 inputs: > > > > > > > > Submit link > First off, why do you have an submit button and a submit link? Second, what are you using to validate the form?
[jQuery] Re: submit a form with a link
Thanks Jörn!! It works! But I continue with a problem because the link Submit has to validate that only input1 of the form is not empty. And the submit button validates that the three inputs are no empty. So I think that I will have two validations for the same form. How can I do that? I have a form with 3 inputs: Submit link Thanks again! Sole
[jQuery] Re: submit a form with a link
> I'm using jquery to validate a form and that I'm using this link to to > the submit: > > < a href="javascript:void(0);" onclick="document.form.submit();"> > Submit This will not work because you are calling the submit method for the form, not any validation script... Also, is there any reason you are using the onclick event handler? > The problem is that this kind of submit doesn't activate the jquery > validation. How can I do to force the validation? Please provide more of your code so we can see exactly what you are trying to accomplish...
[jQuery] Re: submit a form with a link
Try this: $("#submit").click(function() { $("#myForm").submit(); }); Submit Jörn On Mon, Dec 22, 2008 at 2:16 PM, sole wrote: > > Hello! > > I'm using jquery to validate a form and that I'm using this link to to > the submit: > > < a href="javascript:void(0);" onclick="document.form.submit();"> > Submit > > > The problem is that this kind of submit doesn't activate the jquery > validation. How can I do to force the validation? > > Thanks!! Sole >