PDA

View Full Version : checkboxes


habib
10-18-2002, 03:57 PM
Hi All,

I'm using checkboxes for users to select different products, under each checkbox I have a textfield. What I want to do is when a checkbox is selected, the text field is populated with the product description.

Any ideas on how i can do this?

Working example would be gr8!

Thanks in advance
HR

laughbiz
10-22-2002, 12:19 AM
This is a javascript issue rather than php.

What I would do is use the checkbox's onClick event to see if the box is checked or not and depending on the response, load or clear the text box's value property.

For example:

<input name="chkbx" type="checkbox" value="" onClick="if(chkbx.checked){txt.value='hello';}else{txt.value='';}">
<input name="txt" type="text" value="">

Hope this helps


http://www.laughland.biz
"the web site for web sites"