Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you change the TEXTAREA value from a SUBMIT script?

Status
Not open for further replies.

klawuhn

Programmer
Joined
Feb 19, 2002
Messages
4
Location
US
I have a TEXTAREA and a SUBMIT button. I would like to clear the TEXTAREA value so that it doesn't get submitted when the SUBMIT button is pressed. (It is getting too large and I don't process it anyway. It is only for display and I needed a scrolling region.)

I put an ONCLICK event on the SUBMIT button that calls a javascript function that sets the TEXTAREA's value to '', ie. allcomments.value='';. The problem is this only seems to clear the TEXTAREA value for the SUBMIT action if there is an ALERT() following the setting within the function.

Is there another way to remove a control from the SUBMIT action or is there a way to 'commit' the change to the TEXTAREA's value so that the original content is not sent with the SUBMIT?

 
One way you could do that is: Don't put your TEXTAREA within the same form that the SUBMIT button is in.
 
I put the TEXTAREA in another FORM on the page and everything worked well.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top