Thursday, December 24, 2009

Help with HTML textarea coding!!?

Hello I am a novice programmer, who needs to complete this problem for a homework assignment but it giving me a lot of trouble.





Here it is:


A line that says “My name is” followed by a text box with “Sam” already entered in it and the message “Go ahead, change my name.” When the visitor changes the name in the box, an alert should pop up with the message “Sam I am!” Then the value in the text box should change back to Sam.





I simply can't figure out how to get the text area to replace whatever they type with ';Sam'; again.





Here's the code I have so far:


%26lt;html%26gt;


%26lt;head%26gt;


%26lt;title%26gt;Chapter 5, Exercise #1%26lt;/title%26gt;


%26lt;/head%26gt;


%26lt;body bgcolor=';white'; text=';black'; link=';blue';%26gt;




















%26lt;form action=';'; method=';post';%26gt;


My name is:





%26lt;textarea name=';comments'; cols=';8'; rows=';1'; wrap=';soft';





onChange=';alert('Sam I am!')';%26gt;


Sam


%26lt;/textarea%26gt;


. Go ahead and change my name.


%26lt;/form%26gt;





%26lt;/body%26gt;


%26lt;/html%26gt;Help with HTML textarea coding!!?
%26lt;html%26gt;


%26lt;head%26gt;


%26lt;title%26gt;Chapter 5, Exercise #1%26lt;/title%26gt;


%26lt;head%26gt;


%26lt;body bgcolor=';fff'; text=';000'; link=';blue';%26gt; %26lt;!-- forgot the hex for blue :P--%26gt;





%26lt;form action=';'; method=';post';


%26lt;label%26gt;My name is:%26lt;/label%26gt;



%26lt;textarea name=';comments'; cols=';8'; rows=';1'; wrap=';soft'; onChange=';alert(';Sam I am!';)';%26gt;


Sam


%26lt;/textarea%26gt;


%26lt;p%26gt;Go ahead and change my name%26lt;/p%26gt;


%26lt;/form%26gt;


%26lt;/body%26gt;


%26lt;/html%26gt;





Try that.





-Billy

No comments:

Post a Comment