Name:
Location: Bangalore, India

Monday, October 22, 2007

Enable/Disable Textbox based on radio button selection.

<html:radio property="requestAmountActive" value="PartialReturn" onClick="document.forms[0].requestAmount.disabled=false;"> Partial Return < /html:radio>
<html:radio property="requestAmountActive" value="FullReturn" onClick="document.forms[0].requestAmount.disabled=true;"> Full Return< /html:radio>

<html:text property="requestAmount" name="RequestForm" disabled="true" />

When a radio button is selected and main submit is hit, the value that's selected can be anything like a number (or) String. The value is given in value attribute.

Example:

value="PartialReturn"
value="1"
value="True"
value="T"

0 Comments:

Post a Comment

<< Home