Hi Etienne,
CGI forms are "sticky"--they remember their value from the previous call,
even if you manually set a value. Try adding a -force=>1 to the hashref
that gets passed into the submit function
($q->submit(-name=>'submit',-value=>'Modify',-force=>1), for instance), which
should tell CGI.pm that you meant what to reassign the value of the object.
Another option is to not use CGI.pm -- hardcode the submit HTML, or use
something like HTML::Template, but that's a tough thing to implement after the
fact.
darren
Etienne Pelaprat ([EMAIL PROTECTED]) wrote:
> Hi,
>
> I'm having trouble with a script is use for posting, modifying,
> and submiting queued news to a database that gets used by another script
> to (to display stuff in the database).
> When no parameters are passed in, the script displays a list of all the
> articles waiting to be posted (from a database). You select an article
> (with a radio button), and then click submit. This should bring up a new
> page with a form, some fields are filled (based from what's in the
> database), where you can modify the news post before submitting it. At
> the bottom of this page are two buttons, submit and cancel. Cancel brings
> you back to the main page, submit puts it in the database.
>
> My problem is this, the variable name that let's the script know what page
> to display is called 'submit', and it is the value of the buttons on any
> given page. So on the very first page, the button's value ius 'modify',
> and on the modify page there are buttons whose values are 'submit' and
> 'cancel'.
>
> The problem is that the submit value is not changing as it should from
> page to page, it's almost always the value of the previous page, and
> sometimes it changes after reloading. What should I use as the method for
> the form? How does this matter with CGI.pm? Any idea why this variable is
> not changing?
>
> Thanks in advance.
>
> Regards,
>
> Etienne Pelaprat
> [EMAIL PROTECTED]
--
Jazz is not dead...it just smells funny.