469,578 Members | 1,863 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,578 developers. It's quick & easy.

Object doesn't support property or method

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,

Feb 28 '07 #1
2 3609
On Feb 27, 5:05 pm, "Charles" <landema...@gmail.comwrote:
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,
Hm. I'm not inclined to debug your code for you, but to make your
life easier, you should know about a few tools:

Microsoft Script Debugger
http://www.microsoft.com/downloads/d...displaylang=en

Firefox:
http://getfirefox.com

Firebug:
http://getfirebug.com

(though it looks like your error is IE-specific...)

My hunch is that yout "onsubmit" handler is invoking form.submit,
which is unnecessary. Just return true.

-David

Feb 28 '07 #2
On Feb 28, 11:05 am, "Charles" <landema...@gmail.comwrote:
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

Feb 28 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

By using this site, you agree to our Privacy Policy and Terms of Use.