I have the following requirement :
In my webpage I have text box labeled as "Country". Now if I type something on the text box for Country, another text box labeled as "City" should be visible. If I don't type anything on the textbox for Country the "City" should not be visible.
I have the following JSP where I am taking the input for "Country" :
<td width="20%">
<s:label key="partner.Country" cssClass="Labels"></s:label>
<font color="#FF0000">*</font>
</td>
<td width="20%">
<s:textfield id="id_PartnerNameRecv" name="partnerDetails.partnerNameRecv" cssClass="Rectangle-1-Copy-4">onchange="tnKeyPressForCity(this.value)"</s:textfield>
</td>
function tnKeyPressForCity(radioButtonObj){
var keyPressed =radioButtonObj;
if (keyPressed != ""){
$('#id_CityRecv').show();
}
}
I am not sure on how to implement the above feature. This is how I am trying to create my function.