On Feb 28, 11:05 am, "Charles" <landema...@gmail.com> wrote:
> I have a validation script used before submitting a form. When
> executed it says "Object doesn't support property or method". I'm
> using onclick="return validate();" which should be fine. But when you
> click "Submit", you get this error:http://www.auriance.com/docs/tmp/nutrinat/pedido_.php
> Any idea?
> Thanks,
Here:
<input name="submit" type="submit" class="send" id="send"
onclick="return validate();" value="Concluir pedido" />
Firstly, assign the validation function to the form's submit
attribute, then when it returns false it will stop the form
submitting.
Secondly, by calling the button 'submit' you mask the form's submit
method. Don't give control's a name unless you intend to submit its
value with the form, and never call a control "submit" (or reset or
any other method or property of a form).
When your functions calls "form.submit()" it is trying to execute the
button, not the form's submit method.
--
Rob