Click here to Skip to main content
15,904,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My JavaScript Function..

JavaScript
var e = document.getElementById(id);
		if(e.style.display == 'block' || e.style.display=='')
			document.getElementById("TextBox1").value="show";
		else
			document.getElementById("TextBox1").value="hide";
			}


Any Help..
Posted
Updated 26-Dec-11 22:58pm
v3
Comments
Shobana16 27-Dec-11 4:48am    
Do you want to change the value or do show/hide operation for textbox?
VenuKalyan 27-Dec-11 4:53am    
For Textbox Only..
thatraja 27-Dec-11 12:09pm    
Did you check mine?

what you want exactly ? but with your Question title here is answer

JavaScript
document.getElementById("TextBox1").value="show";

give double Quotes to string which used as value.
 
Share this answer
 
Comments
VenuKalyan 27-Dec-11 4:58am    
but it cant work..it gives error..
VenuKalyan 27-Dec-11 5:02am    
Actually my aim is
I have one Hyperlink,Panel,Textbox

When i click on hyperlink panel get show/hide and textbox text='show/hide'
VenuKalyan 27-Dec-11 7:36am    
it works..
Thnq.
Are you using Master pages(ASP.NET) in your application by any chance? If yes then check these

The difference between ID, ClientID and UniqueID[^]
Take Control Of Web Control ClientID Values in ASP.NET[^]
 
Share this answer
 
document.getElementById('<%=TextBox1.ClientID%>').value='show';
 
Share this answer
 
Comments
VenuKalyan 27-Dec-11 5:02am    
Actually my aim is
I have one Hyperlink,Panel,Textbox

When i click on hyperlink panel get show/hide and textbox text='show/hide'
VenuKalyan 27-Dec-11 7:36am    
it works..
Thnq.
if you are using master page concept then you will write:

document.getElementById('<%=TextBox1.ClientID%>').value='show';
 
Share this answer
 
Comments
VenuKalyan 27-Dec-11 7:37am    
it works..
Thnq.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900