By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,876 Members | 1,357 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,876 IT Pros & Developers. It's quick & easy.

how to set text field value as web page title on entering text in text field

P: 10
hi
i am getting trouble in displaying text field value as web page title on entering text in text field.
can any one help me solving this problem
here my code


Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function showtitle(tl)
  5. {
  6. window.document.title=tl;
  7. }
  8. </script>
  9. <body>
  10. <form  name="accepttestpage" method="post"  action="customerdetailsinsertion.php">
  11.  
  12. <p>Customer Name<input type="text" name="cname" maxlength=50 id="cname1" onchange="showtitle(this.id)">/p>
  13. <p>Contact Address</td><td><input type="text" name="address" id="address"></p>
  14. <p><input type=submit  value=Save&print >
  15. <input type=reset value=Reset></p>
  16. </form>
  17. </body>
  18. </html>
Feb 27 '12 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
You want to use this.value, not this.id.
Feb 27 '12 #2

Dormilich
Expert Mod 5K+
P: 8,639
what kind of trouble?
Feb 27 '12 #3

P: 10
yes i want to use this.value i tried but i could not get it
Feb 27 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.