HTML Form/Page and Navigation with multiple buttons

mosscliffe mcl.office at googlemail.com
Thu May 31 11:17:51 EDT 2007


Excellent - thanks for all your help.  I now have a form created by a
python script executing an HTML page, doing everything I need, except
for Session Data (probably use hidden fields ?? future research) and
the actual paging logic !!!

If I use a link.  I have to add all my hidden fields to the query
string, otherwise cgi.FieldStorage(), does not return the hidden
fields. This would also mean users see all the hidden field data.

Is there another way, other than a cookie ?

Why is a link better than a button ?

I have been using 'post' for my form, to eliminate the displaying of
field values.

I accept I am quite niave about FORM/HTML logic.

Richard

On 31 May, 15:30, Bruno Desthuilliers <bruno.
42.desthuilli... at wtf.websiteburo.oops.com> wrote:
> mosscliffe a écrit :
>
>
>
> > I am struggling to find a python example of the scenario - I have.
>
> > I have a python script, which generates a page with a search button
> > (actually an input field).
>
> > The data from the above submissions is interrogated and the same
> > script produces a new search option and the a page of results from the
> > previous search request.  -  as done by Google's Main search page.
>
> > The user then has the option of  a new search or navigating to a
> > different page of results with the usual Start, Previous, Next and
> > Last Buttons.
>
> > How can I identify which button has been pressed.  Do I need a
> > separate form for each button and hide all the relevant session fields
> > in each form or is there a way of identifying which button has been
> > pressed on the page.
>
> This is not really a Python problem - would be the same with any
> server-side techno...
> <OT>
> You shouldn't use buttons for navigation, but links. The simplest
> solution is to pass all the relevant data into the query string (the
> ?key=val&key2=val2&etc=etc part of the url). In your case, this would be
> something like resending all the search params, and adding the current
> page and the action (ie 'action=next' or 'action=first' etc...)
> </OT>





More information about the Python-list mailing list