This topic is locked
[SOLVED]

  Checkbox List

7/7/2011 10:51:21 AM
PHPRunner General questions
S
sthefaine author

I have a checkbox list and I want to show/hide a text field if a certain item in the checkbox list is selected. Anybody have any code examples for phprunner? Thank You Steve

C
cgphp 7/8/2011

If your list is like this:

<input type='checkbox' name='check[]' value='one'/>

<input type='checkbox' name='check[]' value='two'/>

<input type='checkbox' name='check[]' value='three'/>

<input type='checkbox' name='check[]' value='four'/>


$("input[name='check[]']").click(function(e){

if($(this).is(":checked"))

{

//show text

}

else

{

//hide text

}

});