Hai,
I have a php project , which contain a form named contact us , In this when a user submit that form a mail has sent to the administrator.. My aim is to design this page as dynamic. I mean ,the admin can add or change the fields in contact us page. I have implemented a text editor to do this. here the admin can design the contact page. My problem is that i want to validate(both server side and client side) all the fields. how is it possible using javascript.. Does any one Know this ?
In order to make the validation work, you must have a set of predefined fields that can be added to the form.
I my last project, I do the same. There are service form that will be filled by visitor. The service owner can add the custom field in the application control panel, then the visitor will see the field. When designing, there are limited field type that can be added, a normal field: text, textarea, radio, checkbox, dropdown, and special field such as email address. The only validation needed is just required or not, and the special field will carry it's own validation rules along. This custom field data then saved to database.
When displaying this custom field, I use jQuery validation plugins to do in browser validation, while in backend code I also do validation using Form Validation library (I'm using CodeIgniter). All needed rules is carried by the custom field when fetching it from database.
I hope this is what you want to do. You might see wufoo.com to see what a field designer page will looks like. In my project, it's just a simple click and add, no drag and drop functionality. All code using jQuery, written by me for the project usage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With