You are here: Re: Question about form... « HTML « IT news, forums, messages
Re: Question about form...

Posted by Alan J. Flavell on 01/23/06 20:16

On Mon, 23 Jan 2006, Jonathan N. Little wrote:

> Travis Newbury wrote:
> > Leszek wrote:
> >
> > > I tried something like this:
> > > <input type="button" value="<<Back" onclick="history.back()"/>
> > > and it works with my browser
> > > But is the input type="button" working with all browsers?

RTFM.

push buttons: Push buttons have no default behavior. Each push button
may have client-side scripts associated with the element's event
attributes. When an event occurs (e.g., the user presses the button,
releases it, etc.), the associated script is triggered.

Since all the browsers that are known to me have a facility to disable
JS, evidently this does not work with /ANY/ browser, unless the user
settings are in your favour. Hint: design accordingly.

> The way I did it was to have one PHP script handle all pages of the
> multipage form, then for each page I had two submit buttons...
>
> #on Page 1
> <input type="submit" name="back0" value="<<Back">
[...]

That's not very helpful for those who have js disabled, or blocked by
their security policy.

If you're going to offer optional features which can only work with
JS, you might consider *inserting* those features by means of JS, so
that those without JS don't get distracted by them. I think this
feature can be fairly rated as "optional", since browsers tend to have
their own Back buttons.

> Also you can take the opportunity to validate the use input and say
> if the user clicked to go to page 3 and the validation fails you can
> redisplay page 2 with bad fields marked.

I hope I'm misunderstanding you here. If you don't validate the input
server-side then you're crazy; and then it's easy to write out a fresh
page from the server, with any erroneous input flagged.

*After* you've implemented that securely on the server side, you might
then consider optional JS, to flag up any errors more quickly, before
the page is submitted. But that's supposed to be an optional extra
(which, of course, any mischievous user could easily bypass, and
submit rogue values to the server).

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация