| Author: Abhi 10 Oct 2008 | Member Level: Bronze | Rating:  Points: 5 |
<html> <head> <title>(Type a title for your page here)</title> <script type="text/javascript"> function entername() { document.f1.t1.value="Name"; } </script>
</head> <body >
<form name=f1 action='' method=post> Your Userid<input type=text name=t3><br> Your Password<input type=text name=t2><br> Your Name<input type=text name=t1 onfocus='entername()';> </form>
</body> </html>
|
| Author: senthil 10 Oct 2008 | Member Level: Gold | Rating:  Points: 3 |
Focus method can run in the code behind.
u can create the button id=txt_Name
and code behind u write following code:
txt_Name.Focus();
Hope this is help for u....
|
| Author: anil 10 Oct 2008 | Member Level: Gold | Rating:  Points: 5 |
u can do it using javascript as follows.
<html> <head> <script type="text/javascript"> function setStyle(x) { document.getElementById(x).style.background="yellow"; } </script> </head> <body> First name: <input type="text" onfocus="setStyle(this.id)" id="fname"> <br /> Last name: <input type="text" onfocus="setStyle(this.id)" id="lname"> </body> </html>
this change the background color of textbox to yellow on focus.
thank you, anil...
Thanks, Anil.
http://akbbhatt.wordpress.com/ http://anilbhatt.blogspot.com/
If my reply helped you, then please rate this as Excellent, Good or Bad.
|
| Author: Abhi 10 Oct 2008 | Member Level: Diamond | Rating:  Points: 5 |
you can set focus to text box or make change property of textbox on focus.
example: <script language="javascript" type="text/javascript"> function setFocus() { document.getElementById('<%=txtendDate.ClientID%>').focus(); }
</script>
<body unload="setFocus()">
or
script language="javascript" type="text/javascript"> function setFocus(id) { document.getElementById(id).style.background="Red"; }
</script>
<input type="textArea" onfocus="set(this)" id="comment">
Thanks and Regards, Abhay
|