Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: textarea


Message #1 by "Morgan, Rob" <Rob.Morgan@o...> on Mon, 11 Jun 2001 06:47:17 -0400
it does work... try this

<HTML>
<HEAD>
<SCRIPT LANGUAGE=javascript>
<!--
function cleartext(){
 document.forms(0).txtpane.value = "";
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM>
<INPUT TYPE="button" VALUE="Clear" ONCLICK="cleartext()">
<INPUT TYPE="RESET" VALUE="Reset">
<BR>
<TEXTAREA id=txtpane name=txtpane rows=5 cols=46>Test text</TEXTAREA>
</FORM>
</BODY>
</HTML>

-----Original Message-----
From: Morgan, Rob [mailto:Rob.Morgan@o...]
Sent: 11 June 2001 13:05
To: javascript
Subject: [javascript] RE: textarea


I tried that, but it would not get rid of the text that was already there
just newly typed text.  Can you test this to make sure?

-----Original Message-----
From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]
Sent: Monday, June 11, 2001 7:37 AM
To: javascript
Subject: [javascript] RE: textarea


for any kind of form field will reset it to whatever value it had when the
page was loaded.

For a text area or a text box, just set the value to an empty string.

txtArea1.value = "";

-----Original Message-----
From: Morgan, Rob [mailto:Rob.Morgan@o...]
Sent: 11 June 2001 11:47
To: javascript
Subject: [javascript] textarea


Please explain to a JavaScript idiot(me) how I can clear a textarea box on
the screen.  It's an asp page and I load the box with text before it
displays.  A reset seems to only clear what has been typed and not what was
already in the box.  I have a standard submit button on the screen that says
"Compose New" and I want it to clear the textarea.

Thanks
Rob

________________________________________________________________________
Scottish Enterprise Network
http://www.scottish-enterprise.com


  Return to Index