PDA

View Full Version : make checkbox reload page


Try_Try_Again
11-14-2002, 08:11 PM
How do you get a checkbox where if you "check" or "uncheck" an option, the page reloads automatically?--without a "save changes" button.

Do I need javascripting for this?--or can that be done in html?

Thank you!

Try_Try_Again
11-14-2002, 08:23 PM
Sorry, I should clarify that the checkbox attribute would "submit a form", then reload the page. thx.

beetle
11-14-2002, 08:26 PM
This will submit the form when the checkboxed is clicked on and 'checked'

<input type="checkbox" name="whatever" onClick="if (this.checked) this.form.submit();" />

Try_Try_Again
11-14-2002, 08:53 PM
thx beetle, but I think I'm missing something. I have this one page of content but with only one option that can change, which is a checkbox. So, I was hoping I wouldn't have to create a "save changes" button just for that one checkbox.

so, checking the box submits that info and reloads the page with the box checked. unchecking it would also submit and reload the page with the box unchecked.

Any help would be really appreciated.

beetle
11-14-2002, 09:05 PM
Oh. Well, then just remove the condition....

<input type="checkbox" name="whatever" onClick="this.form.submit();" />

Try_Try_Again
11-14-2002, 09:20 PM
awesome, thank you!