• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

PHP Web Form Question

For my web form, I have PHP using the Zend Framework, then i am using mysql for the db.  I have one field on the form where i need the application to output a better error message to the user if the data is entered incorrectly.  How can I add a custom error message to send to the user if their input on that field is wrong?
0
Jack_son_
Asked:
Jack_son_
1 Solution
 
honestman31Commented:
You have to create a function to do that based on your requirements , for example if you are expecting  numbers then the user entered letters, you will need to use a function to verify that  ( you will need to use regular expression ) . and tell the user what mistakes they have done .
0
 
Ray PaseurCommented:
... I have PHP using the Zend Framework, ...
Maybe show us the URL of your test data and the PHP code that creates the response, thanks.
0
 
Lukasz ChmielewskiCommented:
How do you handle the errors in the error controller with the form ?
What is the version of zf ?
0
 
Eddie ShipmanAll-around developerCommented:
Personally, I'd handle validation on the client side using jQuery ValidationEngine plugin:
https://github.com/posabsolute/jQuery-Validation-Engine

Very easy to use and the form does NOT have to be submitted for validation to occur. Validation rules can also be written to use ajax calls to test server side validation such as account existance, etc.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now