Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Ananda Theerthan J: "I have been looking for PHP generator for years and now I am happy that I found one. Yes, its the PHP generator for MySQL. I completely rate 10/10 for this product for making life easier. It has lot of features and capabilities especially the CRUD, lookups and data partitioning. I love this product and recommend to others".
Grey: "We're a two-person company, it's just me an my wife. I'm the technical guru, and she handles the business operations. I have to know a lot about MySQL, but that's much too technical for her. I have frequently had to setup CGI scripts (I code in Perl) so she can manage some of our tables (suppliers, manufacturers, etc).

I discovered PHP Generator a couple of days ago, tried the free version,and within a few hours I had purchased the Pro version (as well as SQL Maestro for MySQL).

Today I am completing the conversion of the last of my custom table managers to PHP Generator. This is eliminating several thousand lines of code that I don't have to support any more!

Thanks for this fantastic product".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

OnEditFormValidate

This event occurs before submitting an edit form. It allows you to detect errors on the client before the form is submitted to the server to avoid the round trip of information necessary for server-side validation.

 

Signature:

function OnEditFormValidate (fieldValues, errorInfo)

 

Parameters:

fieldValues

An associative array of values containing the user input.

errorInfo

An object that provides interface (the SetMessage method) to set a validation error message.

 

Example 1:

To validate the 'percents' value and show a warning message in case of erroneous input, use the following code:

 

if (fieldValues['percents'] < 0 || fieldValues['percents'] > 100)

{

    errorInfo.SetMessage('Percent value should be between 0 and 100.'); 

    return false;

}

 

Example 2:

The following code is used in the NBA demo project to ensure that home and away teams are different for an edited game:

 

if (fieldValues['home_team_id'] == fieldValues['away_team_id'])

{

  errorInfo.SetMessage('"Home" and "Away" must be different');

  return false;

}

 

See also: OnInsertFormValidate



Prev Return to chapter overview Next