christophdb supports this item


This author's response time can be up to 2 business days.

17 comments found.

I want to make a search box with a keyword field on the left and a drop down options on the right to search 5/6 directories/engines.
I don’t need the underlying code (I’ve it) but I need a form builder to build and design that.
Can your item do that?

Hey yamon, I am sorry, but I do not understand. If you have the code why do you need a form builder? But I will try to answer your question: My php class can create a search box and a drop down field. To change the content of the drop down depending on the input field is not possible. You will need ajax or javascript to do this. Please explain more what you need and I will try to help. Best regards, Christoph

Hi Christoph, I mentioned I have the underlying code but not the code for form itself. I need a form with a search text box (field) and a dropdown, something like this:
Can your form builder design that? Thanks.

Hello Yamon, well usually my script creates forms with a three colums layout. 1 column is for the a label text like “please enter your name”. 2 column is for the input field, or select list or something like this. The 3 column is for hints or a small grafik with a hover effect. So the answer is: yes my class can create such a form: it will look like this: $fav->createSelectList(“enter your name”, “select_name”, ...., ‘hint text’); And instead of hint text you add ’<input type=’text’ name=’...’ value=’‘). I hope you understand my explanation. Best regards, Christoph

Looks promising! Clearing the form after submission, prevent multiple submissions, redirect users or saving to db (mySQL) examples would give you instant 5 stars!

Hey sitebuilderone, thank you very much for your comment. 1) clearing the form after submission is possible -> use cleanSession()
2) prevent multiple submission are prevented -> use checkReload()
3) saving to db is possible because you have all values of the form saved in the POST or SESSION variables. -> see example 6 of the live preview. I hope you like the php class and if you have more questions I will try to answer them…

Thank you for responding, should have reviewed the docs a bit more. You have earned a sale!

thank you very much…

Nice form! How can i put the labels op top? for example:

Label here: “Text field”

And how do i send this form to a email you can put in? Is it also possible to have a file type and size validate? for example only zip allowed or png, jepg and gif. with a max size of 200kb, or 20mb


Hey StudioChrisBeats, I added an FAQ entry how to locate the label on top of the input fields. Also I enhanded the php class with three new functions.
1) $fav->isFileType
2) $fav->isFileSizeGreaterThan
3) $fav->isFileSizeSmallerThan.
As soon as the updates are confirmed by codecanyon you can redownload the class and you can use the new functions… Best regards, Christoph

Thanks alot! i have one more question though. How would i make this form work and actually send a email?

Hey StudioChrisBeats, I am not 100% sure what your problem is. 1) do you know the mail function of php? If yes, take all variables from SESSION or POST and send it via mail. 2) or do you want to send an html email? Then you should google “phpmailer class php” 3) or do you have problems to get the variables? Then look at the FAQ of this codecanyon item. It none of that help send me a message and we will try to figure it out via email… Best regards, Christoph

Is there an option to protect your from automated spam registrations and so on? Also, can the source code be embedded into HTML?

hey artzero, I updated the class and added captcha support. You can already see the functionality on the “live preview”. As soon as the updates are reviewed by codecanyon the script has captcha support.

what does this mean: Initialise the class: “require_once(‘formsAndValidation_class.php’);”

Hey billyflowers, if you want to use the functions of a php class you have to do usually two things:
1) include the file with include, include_once, require, require_once (or copy the code into your .php file
2) initialise the class with “new”.

Have a look on this link to get more infos about object oriented programming in php ( or search for “php oop tutorial”.

Best regards,

I was specifically looking for a contact form that did not use jquery… how would I use this without javascript? Shouldn’t you place some reference to jquery or javascript in you file desription area… i.e. software version or files included?

Hey lacrew,
sorry but I am confused. I do not use jquery or javascript for the validation of the forms. The validation is pure PHP and the forms work perfekt with deactivated javascript.

The only exception is the datepicker. This is using jquery. If you don’t want to use the jquery, then just do not use the datepicker function.
Best regards,

I apologize… I should read docs.

hey lacrew,
no problem. :-)


A few questions:

1)Instead of the ‘successfully sent’ message staying on the same page, is there the facility to redirect to another page after the form is submitted?

2) Any facility to display a copy of the message to the user in the redirect page?

3) Does this actually ‘send’ the form, or is some additional script needed to do that?

Hey realbookmarks,

1) yes it is possible and I see two solutions: a) use the redirect function to another page in case of success and all values are saved in the SESSION variable or b) directly jump with the form to another page using form action=anotherpage.php. There is a function of my class to do this.

2) Yes. You have all variables stored in the session. So it is easy to show a copy to the user.

3) There is no additional code or stuff needed. My php class creates the complete form and the validation.
Only if you mean ‘send via email’ then you have to write the php order mail(...).

Best regards,

Excellent! So simple and gets the job done! One thing though… when you enter the captcha code in capitals it rejects the answer. What’s up with that?

Hello mrsd0803, you are right. There is an erroy in the php class in line 479 and I updated the class. As soon as it is approved you can re-download it. Otherwise you can remove the strtolower by yourself in line 479. Thanks for the hint and best regards, Christoph

thanks for that but now I am getting this… Warning: Invalid argument supplied for foreach() in …/formsAndValidation_class.php on line 333… any ideas?

did you redownload the class or did you changed the code by yourself? Please send me an email instead of writing a comment then I will react much faster…

May I to create field which gives words suggestion from database and dont accept a value that is not in db?

Hey proba, that is an easy task. Here a short explanation: 1) assign an id value to the desired input field with autocompletion. Forms and validation allows that. 2) include jquery and jquery ui at the beginning of the page 3) load the values from the database 4) assign the allowed values from the database as autocompletion described on this page:

> Update: oh I see you want that no other values are allowed. Then I see two solutions: a) do not use a input field but a selection list b) you have to check the input of the autocompleteion field against the database entries.

Best regards Christoph

I am not sure I can to do it. Add example how to include jquery and jquery ui to

add the following two lines into the header:

<script src=”//”></script> <script src=”//”></script>

Best regards Christoph

How to add reset button? How to clean form? I add line $fav->cleanSession(); to min_example.php but form is not cleaned after submit.

Hi proba, $fav->cleanSession() is only working if your formID is ‘fav’. If you chose an other name you have to add $fav->cleanSession(‘yourFormID’); Best regards

how do you send it via email? Please advise

okay maybe i phrased that incorrectly How do you send the entered data to an email address for someone to receive it? Such as a contact form and receiving the data someone has entered.

hey jamalsmi, 1) add another input field: $fav = new formsAndValidation(‘zzz’); $fav->addTextInput(‘Receivers E-Mail address’, ‘mail_to’);

2) validate the input: $fav->isEmailAddress(‘mail_to’, ‘please enter a valid eMail’);

3) use it in the mail function: mail($_SESSION‘zzz’, ‘SUBJECT’, $message, ‘From: Name <mail adress>’);

Best regards Christoph

How to use addSelectList with variables from a database? Example, please. $fav->addSelectList(‘test’, ‘test’, array(‘id’), array(‘name’) ); Thank you.

Hey proba, try this:

$tmp_location = array(); $sql_query = mysql_query(“SELECT * FROM locations”); while($location = mysql_fetch_assoc($sql_query)){ $tmp_location[$location[‘id’]] = $location[‘description’]; } $fav->addSelectList(‘Location’, ‘loc_name’, $tmp_location );

Any change to avoid page refresh while validating… ?? Thanks.

sorry forms and validation needs a page refresh. Sorry. You can try jQuery Validation Plugin. Documentation is not perfect yet but it works…


Great tool!!!

Q1) Is there a way to use dependent list, by example: countries and cities, even including externa tools?

Q2) If Q1 s ok, I could use some Ajax to retrive values for second list?

Q3) Can I use “addCode” to write any html and js code?

Q4) Fields use in “addCode” can be save to DB, I mean thiese fields will be include in POST?

Q5) In validation exits a method to check something in server side and response with a error messages to user if not good?

Thank you in advanced.


Hi meridiano, Q1 + Q2) I assign an ID to the selection list and then I use jquery to do some magic. (for example select a location name and fill out dynamically the address of this location based on a database. Write me an email and I will send you the code.

Q3) why do you need addCode to write js code. Just add the js code after the form. For html you have to use addCode.

Q4) Yes if you use the right naming for the input fields… All input fields are transfered by the created form.

Q5) I do not understand the question. Please make an example.

Best regards, Christoph

In form file filed is not required, but if user add file – it has to be picture format. So, if form use function isFileType to test file formats, field for file can not be empty.

How to test file format only if user add file?

Hey Proba, here are some code examples with explanations:

$fav->addUpload(‘File’, ‘upload’); < will add an upload field.

$fav->isEmpty(‘upload’, ‘It is mandatory to add a file’); < makes the upload mandatory

$fav->isFileType(‘upload’, ‘only png, jpg and gif allowed’, array(‘png’, ‘jpg’, ‘gif’) ); < upload is not mandatory but if there is a file added it has to be an png, jpg or gif.

I hope this answered your questions. Best regards, Christoph

I apologize in advance if this has been asked or is otherwise documented, as I couldn’t find the answer. Could you please let me know if fieldsets are supported? I work with LONG, complex forms and fieldsets are a MUST. Thanks!

Hi Brat, fieldsets are not yet supported. But if you would by the script I will add this feature. Best regards Christoph

Thank you for the reply. One more question before I purchase:

Is there a way to wrap my own tags around form elements? Something similar to $form->startTag(‘p’)... $form->endTag(‘p’)? I like being able to customize my own forms, and I have a “home grown” form tool that lets me do this, but I’d prefer to use something more like your uniform class with built-in validation capabilities.

Please let me know ASAP – I am actually working on my project as we speak. Thanks!

Hi Brat, currently there is no such feature but it would be more than easy to add something like that. If you buy the script I will implement this feature for you. Best regards, Christoph

OK I haven’t touched php for ten years or more.Not that it makes a difference . Still dumb. Anyway ready for stupid question. Where does the first form in your example go? How do I get it to send the information to my email address once send request has been clicked. Thank you in advance.

Hi leighjor, there are no stupid questions and I will try my best to answer them. 1) In general my script sends the information of the form to the same page but you can define the target page with “setTarget” 2) It is very easy to get the values from the form. I described it on codecanyon under “support”. Then if you can get the values from the form just use the mail order of php to send it to any email adress.

If this does not help you, please send me a mail. Best regards Christoph