Solved

PHP Web Form Question

Posted on 2012-12-26
4
275 Views
Last Modified: 2013-01-13
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
Comment
Question by:Jack_son_
4 Comments
 
LVL 10

Expert Comment

by:honestman31
Comment Utility
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
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
... 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
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
Comment Utility
How do you handle the errors in the error controller with the form ?
What is the version of zf ?
0
 
LVL 26

Accepted Solution

by:
EddieShipman earned 500 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now