Check boxes in HTML/Dreamweaver?

RockStar

New member
That completely depends on what you want to happen when the box is checked. If you are completing a form, and need to submit data to the next page, you can do that a couple of ways, which I'll get to. But if you need to simply go to another page, then you can do this:

1. Create the check box.
2. Use the code navigator to find the check box in the html or find it manually by switch to code view.
3. insert the following attribute into the checkbox's tag: onchange=" document . location.href=' /another_folder / some_page.html'"

(take out the space... I had to add those so that this would show up in the answer.)

If you need to submit information, you'll need to create a javascript function that submits data to the next page. It could be something like:

<input type ="checkbox" id="find_it" value="purple" onchange ="ch_box_subm( '/another.html', this.value)" />

<script type="text / javascript">
function ch_box_subm( url, val )
{
document . location.href= url + '?color=' + val;
}
</script>

of course that's way over simplified, but I have no idea what you're trying to do. I find editing the code directly is the simplest method, but you could also right click in design mode (not live-view) and edit the events that fire for this check box. But you'll be doing the same amount of work.
 
Back
Top