Re: Form Validation (revisited)

From: Roger Price (roger_price_at_btinternet.com)
Date: 02/08/04


Date: Sun, 8 Feb 2004 12:30:07 +0000 (UTC)

Geoff & Jock

I do appreciate the "conversation" that you have been engaging on my behalf
which I have found most informative.

I should say that the page I am working with is part of an assignment for
the "Internet Programming Module" of an on-line MSc in IT run by the
University of Liverpool.

The purpose of the page is to demonstrate my understanding of PHP (very
limited though it is).

The page is called "email.php" and <form action="email.php"> so the submit
button initiates a recursive call.

I check at the top of the page to using "isset" so see if $_POST['submit']
(Geoff thank you for this shorter var name) is true in which case I test
the value of emailAddress against my "regexp" string.

In the event that the "reset" button is pressed (it is of type "submit" but
with the name "reset" - I similarly test for that and reset "emailAddress"
to "".

So you see that there is no "initial page" to return to really.

In the real world I would never consider using PHP for this purpose but
validate (I know that this is not really a validation - just a check to see
that the email address has been entered in the correct format) using JS
(work of the Devil notwithstanding).

I now understand where you are both coming from re "usability blunders" and
I will bear your comments in mind when creating a "real" webpage.

I originally requested help an a specific problem but have had the benefit
of a "seminar" on the subject for which I am very grateful.

Next week we will be using PHP to read and write to an MS Access database (
no don't even ask... I would have chosen MySQL as it seems more appropriate
to what the rest of the web community is doing) so I am sure I will have
even more queries. We also have to use IIS 5 instead of Apache - strange
choice, but I now have a much greater respect for Apache.

Thanks for all your advice

Roger

 

     

in article MPG.1a90136bc1ce6bb1989688@News.Individual.NET, John Dunlop at
john+usenet@johndunlop.info wrote on 8/2/04 9:36 am:

> Geoff Berrow wrote:
>
>> And I'm not sure what you mean by 'usability blunder'.
>
> The fact that a submit button (which causes a request to be made) is
> disguised as a reset button (which doesn't cause a request to be
> made) is a usability blunder IMO. A submit button with a value of
> "reset" looks to the average user like a run-of-the-mill reset
> button. But it's not. That's apparently not happened here though.
>
>> He has a form. When submitted the entries are validated. If they fail
>> he now has it so that the values are redisplayed.
>
> Right. I'm not sure of the reason behind displaying failed values in
> the INPUT though. Why would a user wish to recheck a value she's
> discovered is invalid only moments before?
>
>> If he wants to allow the user to clear all the input boxes, he cannot
>> use reset - it won't work.
>
> Ah, that's where our wires crossed I think. The reset button
> certainly won't clear the INPUT if a value attribute is specified.
>
>> The only way to do it is to re display the original form.
>
> Which'd be overkill IMO.
>
>> Having a separate form with the action pointing to the original URL will
>> do it. He could always label that button 'clear all fields'. Would
>> that work for you?
>
> Well, that'd avoid my "usability blunder", yes. :-) But I don't see
> the point in it.



Relevant Pages

  • Re: Is This a Fake Message?
    ... Appears to be the standard message when requesting a password reset. ... If not requested, then your email address was most likely obtained by malware from an address book on your or another's systems, use of your address in location publicly available on the internet, and/or a bot algorithm capable of finding your username. ... "MIKE SHEFFIELD" wrote in message ... IF YOU DID NOT REQUEST TO RESET YOUR PASSWORD: ...
    (microsoft.public.internet.mail)
  • Re: I receive the same email from "Microsoft Customer Support" ev
    ... Reset your Windows Live password? ... We received your request to reset your Windows Live password. ... Follow the instructions on the web page that opens. ...
    (microsoft.public.security)
  • Re: Attributes that Update during Computer logon
    ... You mention that the computer may request its password to be reset, ... Finally you mentioned that "lastLogon" was not replicated but is the ... roving disconnected for some time and it won't matter. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Attributes that Update during Computer logon
    ... You mention that the computer may request its password to be reset, ... Finally you mentioned that "lastLogon" was not replicated but is the ... This attribute is also Integer8 and is replicated. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Form Validation (revisited)
    ... Jock and Geoff ... Thank you for your responses. ... I am completely new to PHP and only began studying it last Thursday so ... However if I press "reset" the field ...
    (comp.lang.php)