Text box disable with value of Check box
677690Apr 11 2009 — edited Apr 13 2009Hello folks,
I'm trying to enable or disable text box with the value of CHECK BOX, I'm have achieved the same with the RADIO BUTTON, with the javascript as follows:-
HTML HEADER
----------------------
<script type="text/javascript">
function disableOnValue(o)
{
if (o.value == 'Y')
{
document.getElementById('P2_TEXT_BOX1').disabled = false;
document.getElementById('P2_TEXT_BOX2').disabled = false;
document.getElementById('P2_TEXT_BOX3').disabled = false;
}
else
{
document.getElementById('P2_TEXT_BOX1').disabled = true;
document.getElementById('P2_TEXT_BOX2').disabled = true;
document.getElementById('P2_TEXT_BOX3').disabled = true;
}
}
</script>
---------------------
and under Region Source whose Display Point is <b>Before Footer</b> and sequence is the last sequence of all the region
----------------
<script type="text/javascript">
if(document.getElementById('P2_RADIO_BUTTON_0').checked == true)
{disableOnValue(document.getElementById('P2_RADIO_BUTTON_0'));}
else
{disableOnValue(document.getElementById('P2_RADIO_BUTTON_1'));}
</script>
----------------
and finally under RADIO_BUTTON item, HTML Form Element Attributes :-
-----------
onchange="javascript:disableOnValue(this);"
----------
the above thing works very much fine with the help of the RADIOBUTTON, but I wanna give try same thing with the CHECK_BOX I also tried couple of changes but didn't got any success so if anybody help me out the same that will be great and appreciated!!
Thanks
regards,
Kumar