HTML Form/Page and Navigation with multiple buttons
mosscliffe
mcl.office at googlemail.com
Thu May 31 13:25:35 EDT 2007
On May 31, 5:19 pm, Steve Holden <s... at holdenweb.com> wrote:
> mosscliffe wrote:
> > 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 !!!
>
> In fact you should find you can name all of the buttons the same. Then
> when you click one the value associated with that name tells you which
> button the user pressed.
>
> Just don't call your button "submit", since that masks a JavaScript form
> method that you will probably end up using sooner or later.
>
> > 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 ?
>
> Beats me why you got that advice. Buttons are perfectly adequate for
> that purpose.
>
> However, you can if you want use links with "javascript: ..." href
> values to accomplish local scripting which can do funky stuff like
> setting form field values and submitting the form. This can get tricky
> though, and it sounds like you are maybe a little too new to the web to
> be messing with client-side scripting. Later ...
>
> > I have been using 'post' for my form, to eliminate the displaying of
> > field values.
>
> That does make the location bar easier on the user's eye, and is the
> standard way to proceed. It doesn't add anything in the way of security,
> however.
>
> > I accept I am quite niave about FORM/HTML logic.
>
> We all have to start somewhere!
>
> regards
> Steve
> --
> Steve Holden +1 571 484 6266 +1 800 494 3119
> Holden Web LLC/Ltd http://www.holdenweb.com
> Skype: holdenweb http://del.icio.us/steve.holden
> ------------------ Asciimercial ---------------------
> Get on the web: Blog, lens and tag your way to fame!!
> holdenweb.blogspot.com squidoo.com/pythonology
> tagged items: del.icio.us/steve.holden/python
> All these services currently offer free registration!
> -------------- Thank You for Reading ----------------
Mr Holden,
Thanks for the button naming tip.
Just aquired your book, so hopefully I will need to ask less questions
in the future. Sorting out some sort of session management is my next
task.
Being a bit old fashioned, I am against javascript, because I need my
site to work with simple mobile phone browsers, which do not always
support javascript.
Richard
More information about the Python-list
mailing list