Reply to Re: Question about form...

Your name:

Reply:


Posted by Jonathan N. Little on 01/23/06 21:40

Alan J. Flavell wrote:

> 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.

Do you mean me?

>
> 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">
>
> [...]
>
This has absolutely *nothing* to do with JavaScript! Do you seen any
'onclick' or any other event handler in my example? The server-side PHP
processes the value! If you click the *submit* button then the parameter
"back#" will be present in the query or content (if GET or POST), else
a "next#" will be

if(isset($_REQUEST['next3'])){
//User is trying to go to page 3!!!!
....

> That's not very helpful for those who have js disabled, or blocked by
> their security policy.
>
Again this is server-side! But just for your benefit, I do also have
JavaScript that attach and onclick and onsubmit handlers of *if*
JavaScript is available then I can pretest and catch errors *before*
making a server call...

> 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).

Again, I chalk this all up to that you misread my post.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

[Back to original 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

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