How to use javascript to include struts html tag?
Posted
by Dj
on Stack Overflow
See other posts from Stack Overflow
or by Dj
Published on 2010-03-19T06:07:55Z
Indexed on
2010/03/19
6:11 UTC
Read the original article
Hit count: 243
I have a check box and a text box. I have used struts tags and
Now i need to validate that if the check box is checked, i should gray out (disable) the text box. If it is unchecked the text box shold take phone numbers.
I did lik this, i called a java script on click of check box and did a innerHtml based on wheather checkbox ix checked or not.
var status_check=document.getElementById("line1Checked").checked; if(status_check==true){ text=""; } else{ text=""; } alert(text); document.getElementById("line1").innerHTML=text;
this works but if i use,
var status_check=document.getElementById("line1Checked").checked;
if(status_check==true){
";
}
else{
"; }
alert(text);
document.getElementById("line1").innerHTML=text;
It doesn work. All i know is struts tags execute at server. is there any possiblity to achieve this?
Please help me.
© Stack Overflow or respective owner