Forum Moderators: open

Message Too Old, No Replies

Submit Form with Checkbox

         

Robber

12:26 pm on May 12, 2005 (gmt 0)

10+ Year Member



Might sound strange but is it possible to trigger a form submission when someone clicks a checbox.

What I want to do is reload the same page with an expanded list of choices depending on the checkbox they tick, as well as selecting the ticked checkbox.

I am looking at using onclick="document.formname.submit();return false;"

But I am getting object doesn't support this property or methid.

Thanks

Bernard Marx

2:02 pm on May 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Should be OK.
My guess is that you've made the common mistake of giving your submit button the name, 'submit'. This overrides the membername for the form's submit method.

Try:

onclick="if(this.checked) this.form.submit();"

..after renaming the submit button!