JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 18th, 2012, 07:19 PM
tyler_long_sim tyler_long_sim is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 13 tyler_long_sim User rank is Corporal (100 - 500 Reputation Level)tyler_long_sim User rank is Corporal (100 - 500 Reputation Level)tyler_long_sim User rank is Corporal (100 - 500 Reputation Level)tyler_long_sim User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 h 23 m 4 sec
Reputation Power: 0
Why dont this work

the problem is the button dose not change to the text which is entered in the text box


Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Send message</title> <script> changeButton(){ $("#button1").text($("#username").vale); } </script> </head> <body> <form action="?op=login" id="theform" method="POST"> <fieldset> <legend>Login</legend> Username: <input name="username" type="text" id="name" onkeyup="changeButton()" size="15" /><br /> Password: <input id="message" type="text" name="password" size="8"><br /> <button id="button1">Send Message</button>​ </fieldset> </form> </body> </html>

Reply With Quote
  #2  
Old November 18th, 2012, 07:24 PM
Jacques1's Avatar
Jacques1 Jacques1 is online now
pollyanna
Click here for more information.
 
Join Date: Jul 2012
Location: Germany
Posts: 1,835 Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 1 Day 3 h 2 m 6 sec
Reputation Power: 811
Hi,

I can barely read that, but I guess

Code:
$("#username").vale


should be "value". Check the JavaScript console of your browser to debug your scripts. It will display all errors and other info.

Reply With Quote
  #3  
Old November 18th, 2012, 07:30 PM
tyler_long_sim tyler_long_sim is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 13 tyler_long_sim User rank is Corporal (100 - 500 Reputation Level)tyler_long_sim User rank is Corporal (100 - 500 Reputation Level)tyler_long_sim User rank is Corporal (100 - 500 Reputation Level)tyler_long_sim User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 h 23 m 4 sec
Reputation Power: 0
came up with this error

Uncaught SyntaxError: Unexpected token { private-mess.php:7

Uncaught ReferenceError: changeButton is not defined private-mess.php:17



this is a clearer version


Code:
Original - Code
    <script type="text/javascript">   changeButton(){     $("#button1").text($("#username").value); }   </script> </head> <body> <form action="?op=login" id="theform" method="POST">   <fieldset>   <legend>Login</legend> Username: <input name="username" type="text" id="name" onkeyup="changeButton()" size="15" /><br /> Password:  <input id="message" type="text"  name="password" size="8"><br />     <button id="button1">Send Message</button>​         </fieldset>    </form>

Reply With Quote
  #4  
Old November 19th, 2012, 02:39 AM
Winters Winters is offline
Super Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jul 2003
Posts: 3,871 Winters User rank is General 24th Grade (Above 100000 Reputation Level)Winters User rank is General 24th Grade (Above 100000 Reputation Level)Winters User rank is General 24th Grade (Above 100000 Reputation Level)Winters User rank is General 24th Grade (Above 100000 Reputation Level)Winters User rank is General 24th Grade (Above 100000 Reputation Level)Winters User rank is General 24th Grade (Above 100000 Reputation Level)Winters User rank is General 24th Grade (Above 100000 Reputation Level)Winters User rank is General 24th Grade (Above 100000 Reputation Level)Winters User rank is General 24th Grade (Above 100000 Reputation Level)Winters User rank is General 24th Grade (Above 100000 Reputation Level)Winters User rank is General 24th Grade (Above 100000 Reputation Level)Winters User rank is General 24th Grade (Above 100000 Reputation Level)Winters User rank is General 24th Grade (Above 100000 Reputation Level)Winters User rank is General 24th Grade (Above 100000 Reputation Level)Winters User rank is General 24th Grade (Above 100000 Reputation Level)Winters User rank is General 24th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 1 Day 16 h 30 m 42 sec
Reputation Power: 2569
Code:
function changeButton(){
    $("#button1").text($("#username").value);
}
__________________
[PHP] | [Perl] | [Python] | [Java] != [JavaScript] | [XML] | [ANSI C] | [C++] | [LUA] | [MySQL] | [FirebirdSQL] | [PostgreSQL] | [HTML] | [XHTML] | [CSS]

W3Fools - A W3Schools Intervention.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Why dont this work

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap