Solved

PHP Web Form Question

Posted on 2012-12-26
4
277 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
ID: 38722643
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 109

Expert Comment

by:Ray Paseur
ID: 38722650
... 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
ID: 38723484
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
ID: 38755317
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

773 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