I have a group of checkboxes with same name. One textbox is associated with each checkbox. On page load, I am disabling all the textboxes. On click of each checkbox, the textbox corresponding to the checkbox should be enabled.
The problem is that, I tried with different codes to enable the textbox on checkbox click. But the checkbox click function is not working.
The code is as given below (I am using MVC framework):
{loopstart:setting:100}
{if($setting%2==0)}
<tr height="30">
{endif}
<td align="left">
<input type="checkbox" name="settingcheck" id="setting{$setting[0]}" value="{$setting[0]}"/>{$setting[1]}
</td> <td>
<input type="text" size="2px" id="text{$setting[0]}">
</td>
{if($setting%2==1)}
<td> </td>
{endif}
{loopend:setting}
JQuery
$(document).ready(function(){
$("INPUT[type=text]").prop("disabled",true);
$("INPUT[type=text]").css("background-color", "#ccc");
});
This code is for disabling all textboxes on page load and is working fine.
$('input[name='settingcheck']:checked').click(function() {
}
I wrote the above function for enabling the text box on corresponding checkbox click. But this function is not working. I tried alerting some text in this function.
Is there any problem in the code. Can anyone help me to solve this. Thanks in advance.
settingchecklook like a variable color or a string color? ;)