• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hide textbox based on selection

 
Rajesh murthy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing issues in hide and visibility of text box in jsp. whenever I am selecting a radio button I need to hide one textbox.It's working fine.the problem here is ,after hiding the space occupied by the text box is not removing,does any body know how to do it.Please help me,it's very urgent.
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you hidding it using javascript or logic in your JSP. Posting the JSP and any relevant javascript would help. Also, the html source that is creating the blank space might help as well.
 
Rajesh murthy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
function hideText(value){
if(value =='GROSS'){
document.getElementById('GrossRatetxt').value = '';
document.getElementById('GrossRatetxt').disabled = false;
document.getElementById('grossDiv').style.visibility = 'visible';
document.getElementById('netDiv').style.visibility = 'hidden';
}
else if(value =='NET'){
document.getElementById('NetRatetxt').value = '';
document.getElementById('NetRatetxt').disabled = false;
document.getElementById('grossDiv').style.visibility = 'hidden';
document.getElementById('netDiv').style.visibility = 'visible';
}
}


div id="grossDiv" align="justify"

html:text property="grossRate"
styleClass="InputTxt10black" size="30" maxlength="10"
styleId="GrossRatetxt"
/html:text /span
/div

html:radio property="grossNetInd" value="GROSS"

styleId="Gross"
html:radio
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe try putting each of your input fields in a <div>, then control the display by setting style.display of the div to either inline or none.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic