[prev] [thread] [next] [lurker] [Date index for 2003/11/25]
On Tue, 25 Nov 2003, Richard Clamp wrote:
> On Tue, Nov 25, 2003 at 09:09:00AM +0200, svn@xxx.xx.xx wrote:
> > + if ($q->param('submit')) {
> [snip]
> > -<tr><td></td><td><input type="submit" value="Register"></td></tr>
> > +<tr><td></td><td><input type="submit" name="submit" value="Register"></td></tr>
>
> Although in my life I've generally tried to forget as much as possible
> about CGI and web browsers, this is probably going to go badly.
>
> Most browsers will support submitting a form by hitting enter one of
> their form elementes. When this happens they tend not to send a value
> for the submit button.
Actually this is exactly what I wanted. If I understand you.
So if the 'submit' field has no value we can assume this is the first time
the page comes up and we just show the form.
If there is a value for 'submit' then we know it was submitted so we check
if the values were correct and process them possibly giving back the
same page with some error message.
Of course if there are browsers that don't send back value for the button
then we are @%@#$%@% -d.
Gabor
Generated at 09:06 on 27 Nov 2003 by mariachi 0.51