PDA

View Full Version : how to pass this.form like value in text link ??



PHPycho
May 23rd, 2007, 01:35 PM
hello forums !!
i had a text link to submit the form
Ex:

<a href="#" onclick="validate(this.form,this.form.length)">submit</a>

i want to pass those values but errors occurs, this.form is not a property, but i need to pass that value because my validation requires so...
any idea !!
awaiting for your help

Arty Effem
May 23rd, 2007, 03:28 PM
hello forums !!
i had a text link to submit the form
Ex:


i want to pass those values but errors occurs, this.form is not a property, but i need to pass that value because my validation requires so...
any idea !!
awaiting for your helpIf you use a link to submit a form, it won't prevent submission if validation fails, and does nothing if JS is disabled.
If a validation function receives a form reference, it shouldn't need to be told the form's length.

glenngv
May 23rd, 2007, 04:12 PM
And I think the script wants form.elements.length and not form.length. If there are multiple forms, form.length will return the number of forms and not the number of elements.