in reply to resetting form values

I think this is a typical "I want to ask $a, but do so by first asking $b, then complain and ask $a afterall", for I have given your post some thought and cannot think of any useful reason to reset a form when a user submits it.

If I get this right, you want the user to fill out a couple of form elements. After (s)he filled that out and presses the submit button, you want to clear all input and submit empty fields to your CGI script? Why offer a form? Why not call the script directly?

Personally I hate reset buttons/functions because I always hit them by accident, resulting in typing the input twice (usually I pay more attention to what button to press the second time around ;) If I mistakenly filled out a form, I'll delete it myself, or just leave the site, but all this is besides the point.

The point/question is: what do you really want with your form?

--
b10m

All code is usually tested, but rarely trusted.

Replies are listed 'Best First'.
Re: Re: resetting form values
by pmachin (Initiate) on Mar 02, 2004 at 19:19 UTC
    First off I apologize for my ignorance, it probably's stinking up the halls of the temple but here it goes...
    (You're right b10m I was a little vague and this is $a afterall)
    The problem is this:
    I have a script a.cgi in which I have a form that submits the name of a text field to another script, b.cgi. Then b.cgi uses this name (does something) and returns it back to a.cgi (via a hidden field) to display this name in the some html generated by a.cgi after it returns from b.cgi. (This is for a forum. The main page (a.cgi) contains a request for new thread in the form of a text box. Once a name for a new thread is entered, you are taken to the writting page (b.cgi). Then you're redirected back to a.cgi to display the name of the posting as a n html link to the actual post (a text page generated in the previous page) ) The problem is that a single post has been posted and I'm back in a.cgi looking at the hyperlink, if I press reload, another identical last thread link appears. This is because the a.cgi form that first forwarded the name is retaining its last entered value and creating a form everytime a.cgi is refreshed. (I dont mind that the form that creates a new thread is run everytime the page is refreshed since I have a check that doesn't write the thread if the name entered is less than four characters in length such that when a new form tries to be generated with a blank name it is ignored)
    I actually got the forum going by making it only display the forum link in a.cgi if the last page was b.cgi (the page in which the form is written) and the form name is not in the log file that contains all of the thread names. However, I shouldn't need the first check. How can I get a fresh form everytime the page is refreshed without using these checks?