Hi Darren,
i've put in the force parameter as you suggested, and things seem to be
working a lot better. I think the problem may now lie in the method of
the form. I read on w3 that they suggest 'post' for when there are no
visible changes, and 'get' when there are (or perhaps the other way
around). This seems a bit confusing. What is the difference in laymen's
terms? Also, could the problems I'm seeing when I test the script be a
caching issue? For example, I select an article to modify and then I hit
cancel, then I go back to the original page where I select an article to
modify and hit 'modify', it sends me to the cancel page. Checking the
source of the select page the 'submit' variable was set to 'modify' as it
should have been... if it is a caching issue, do you any way to fix that?
Thanks in advance,
Etienne
> 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.
>