Active Server Pages

Moderators: None (Apply to moderate this forum)
Number of threads: 1739
Number of posts: 4450

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Textbox hide and show with button click Posted by hiren_rajpura on 19 Jan 2004 at 5:49 AM
hello everybody

i am new to ASP. I want to know that how can i hide textbox and show textbox on button's click. Please help me in this context.


Report
Re: Textbox hide and show with button click Posted by lillu on 29 Jan 2004 at 5:45 AM
Button click? It sounds like client side activity so you can handle it with javascript. Here's a sample:

<html>
<head>
<script type="text/javascript">
// toggle visibility

function toggle(id){
if (document.getElementById){
el = document.getElementById(id);
if (el.style.display == "none"){
el.style.display = "";
} else {
el.style.display = "none";
}
}
}
</script>
</head>
<body>

<input type='button' name='button1' value='Show/Hide textbox' onclick="toggle('id1');return false;" />
<input type="text" id='id1' />
</body>
</html>

Well, if it's about a choice that will make something happen on the server, you must deal with that server-side.

: hello everybody
:
: i am new to ASP. I want to know that how can i hide textbox and show textbox on button's click. Please help me in this context.
:
:
:


To err is human, but to really foul things up requires a computer. (Farmers Almanac)




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.