Is this re-using a form at any point? Try copying-and-pasting that URL into a new window. That'll rule out anything to do with the form being part of your problem. (Which doesn't look to be at fault anyway.
But it looks like 'DeleteContact' is being fired off when it really shouldn't be. I would be quite suspicious (and this is with the caveat - I don't have a test environment, and even if I did, the first thing to do would be reformat and use strict and warnings on your code).
This bit would make me suspicious though:
$q->start_form(), $q->p(submit(-name =>'action',-value =>'Update'), submit(-name =>' +action',-value =>'Delete')), $q->end_form();
Having had a quick look at 'CGI' (and not much experience) it _seems_ this will create two buttons called 'action' with different values? And more importantly - the default for 'start_form' is that 'action' is POST. Not 'GET'.
From: CGI Starting/ending forms
"start_form() will return a <form> tag with the optional method, action and form encoding that you specify. The defaults are:
method: POST action: this script
So I think it's possible that what's happening is you're resubmitting the same URL (with your 'GET' encoded parameters in the URL) but POSTing data to it too.
From: Mixing POST and URL parameters "The param() method will always return the contents of the POSTed fill-out form, ignoring the URL's query string."
So I think what you need to do is fix that bit - change the method to 'GET' and you'll at least see it doing the right thing. (But seriously - strict and warnings are good, and so is formatting your code cleanly. perltidy can make this easier)
In reply to Re^3: Passing form parameters same CGI page
by Preceptor
in thread Passing form parameters same CGI page
by newtoperl101
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |