php3-list | 199903

Re: [PHP3] Error Handling Questions From: Manuel Lemos (mlemos <email protected>)
Date: 03/31/99

Hello Chris,

On 31-Mar-99 21:28:28, you wrote:

>> Has many people know I have written a class for PHP that process generates
>> and process forms from simple descriptions. It provides many built-in
>> types of both client (Javascript based) and server (PHP based) side
>> validation.

>This sounds like oohforms. What is your understanding as to which browsers
>(version x OS x browser type) support the client-side Javascript--validation
>and popup window.

My class has been extensively tested in many browser versions. It doesn't
rely on browser versions to determine which Javascript can be used. The
Javascript code that it generates checks if a functions that were not
available in Javascript 1.0 before running code that uses those functions.
So it works without errors in ancient browsers like IE 3.01.

In browsers where important functions are not availble, fallback code is
provide do at least some validation. For instance there was not Regular
Expression object support before Javascript 1.2. So, the generate code
tests if string match method exists before running Regular Expression code.

Since Regular expressions are needed for proper e-mail address validation,
my class also generates some fallback code for when regular expressions are
not available. Such code is not as strict as the regular expression based
code but it is ok to avoid many cases of invalid e-mail address input.

There are also some important details like working arround some browser
bugs. For instance, as you know Javascript is embedded in pages inside
HTML comments. Some browsers' parsers assume comment end in the middle of
Javascript code if they found a bigger then sign > . The code that my class
generates avoids this by switch the side of comparision operators as
needed, so all > signs become < and the buggy browsers do not assume end
comment there.

>> Mail me privately if you would like to get a copy of my class with a
>> working example.

>How might your class improve on oohforms?

I am not fully aware of all features of oohforms class. But feel free to
ask if somehow my class supports a particular feature of oohforms.

Anyway, my class supports some not very common but important features a lot
of people appreciate, like:

- Attaching text labels with associated activation key shortcuts for any
  text input.

- Let you define a function to define tab key activation order.

- Support automatic capitalization option for text fields, ie, you may
  request that a text field be made of all of upper or lower case text.

- It lets you request the generation of Javascript functions that you
  may use for instance assign to your page onload event to do things like
  giving the input focus to a given field or select it text contents.

Other than that it supports a reasonable list of built-in field validation
types and associated error messages besides programmer defined client and
server side validation functions.

I have already listed here my class built-in validation types. Maybe I
should put it all in a page but I have been swamped with my work. Here it
follows again anyway.

AsEmail - As possibly valid e-mail address.
RegularExpression - As a given regular expression
AsNotEmpty - With a non empty some value
AsEqualTo - the field must be equal to some other - useful for password
        confirmation fields.
AsDifferentFrom - the field must be different to some other - useful for
        password reminders that must not be the same thing as the password it self.
AsSet - for a group of checkboxes or radio buttons that must have something set.
AsInteger - the value in the field must be a valid integer with range checking.
AsFloat - the value in the field must be a valid floting point number.

Regards,
Manuel Lemos

E-mail: mlemos <email protected>
URL: http://www.e-na.net/the_author.html
PGP key: finger://mlemos <email protected>

--

-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3 List administrator: zeev-list-admin <email protected>