If you want the content of the form submitted so that cgi can do something
with it, but nothing in the browser to change (the page doesn't get reloaded
do the following:

<form name="form" action="/cgi/chat_writer.pl" onSubmit="return false;"
target="messages" method="POST">
onSubmit="return false;" - it processes the action when either you click a
button that has <input type="submit"> or whenever you call this
(window.document.form_name.submit();), but doesn't return anything

And then the button to clear should be:
<input type="button" value="Clear Chat"
onClick="javascript:window.location'/cgi/chat_clear.pl'">

If you want to clear textarea you should do this:
<input type="button" value="Clear Message"
onClick="window.document.form_name.textarea_name.value='';">

I hope this helps :),
Ksenia.

-----Original Message-----
From: David Gilden [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 06, 2001 3:45 PM
To: CGI Beginners
Subject: javascript and perl/cgi 


Hi,
 
In the following:

<form name="form" action="/cgi/chat_writer.pl" target="messages"
method="POST">
Name: <input type="text" size="30" name="name"><br>
Email: &nbsp;<input type="text" size="30" name="email"> <br>

<h3>Type your chat message <input type="submit" value="Send message!">

<input type="button" value="Clear Chat" onClick="/cgi/chat_clear.pl"></h3>

<!--  This does not work here, all I want to do is call, which clears out a
data file on 
the sever, we do not anything returned, in fact can you have a cgi where
after
clicking the submit button you call a script, it does something like log
something like
a users email, and not return anything to the browser?  -->

<input type="button" value="Clear Message"
onClick="document.form.chat.value=' '">


<!--Above how do I clear the textarea 'chat', with out a leaving a leading
space, '' won't work on my Mac using ie5 -->

<textarea cols="60" rows="4" name='chat'></textarea></form></td>



Thanks for any pointers on these two issues,
Thanks

Dave


*====================================================*
*   Cora Connection Your West African Music Source   *  
*   http://www.coraconnection.com/                   *  
*   Resources, Recordings, Instruments & More!       *
*====================================================*

Reply via email to