Login Retreive lost passwordRegister
Search

Forum Index / General / New Validator using current validation

[ This topic is solved ]

  Chad 12 May 08 / 16:39  
My goal: validate an email address in our database.

What I think we need to do.. First validate the email address as being in a valid format. In doing so, I'd like to use the existing email validator in FormHandler. After that passes, I'd like to move ahead with our "special" validation by performing a select from our database and then whatever else is necessary.

Will someone point me on how to use the internal validator within my custom validation routine?

Thanks for any help.

  Johan Wiegel (Admin) 12 May 08 / 17:04  
Since all validators are in a separate class, you can initiate that class and use the validators in your own function.

The next verion of FormHandler will allow you to name multiple validators in one field

  Chad 12 May 08 / 18:42  
I should have thought about that one! Thanks, I have it working.

My next question...

If everything validates as expected and our routine (web service actually) that saves the information to the database returns an error; is there a to redisplay the form with a general error on the page asking to resubmit?

Thanks!

  Chad 12 May 08 / 18:47  
By the way, we have not used the database features of FormHandler because our data is spread across several tables. It did not seem straight forward in the documentation on how to handle an insert/update involving multiple tables represented by a single page form built using FormHandler.

Thanks again!

  Johan Wiegel (Admin) 12 May 08 / 19:07  
 Quote: Chad
 
By the way, we have not used the database features of FormHandler because our data is spread across several tables. It did not seem straight forward in the documentation on how to handle an insert/update involving multiple tables represented by a single page form built using FormHandler.

Thanks again!


That is not possible. In that case you must use youre own database handling.

  Chad 12 May 08 / 19:58  
That was our guess but no problem!

So, is there a way to tell the form to re-display when our routine catches an error? Even though all of the field validations have succeeded?

Thanks!

  Chad 12 May 08 / 20:41  
OK, I see the error of my ways!

In testing, my onCorrect("Finish_and_move_On") function had true misspelled and it was not working! When I returned "true" instead of "ture;" everything worked as expected!

Sorry for the trouble!

I must say, FormHandler was a great find for us and from my immediate testing, it will save us a ton of time dealing with displaying form for an application we are about to write!

THANKS FOR SUCH A GREAT OPEN SOURCE PRODUCT!

  Top


powered by PHP-GLOBE   © 2004 - 2008 FormHandler. All rights reserved.   -   Open source license