The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.28 (Linux)
|
How do I setup required fields with Form Tools? - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: How do I setup required fields with Form Tools? (/showthread.php?tid=870) |
How do I setup required fields with Form Tools? - SteadmanTech - Sep 30th, 2010 Seems like it would be simple or obvious but I've searched the site and forums and cannot find any info. Maybe I'm looking in the wrong places? How can I setup my form and Form Tools to make certain form fields required for submission? Thanks! RE: How do I setup required fields with Form Tools? - mrsalvage - Sep 30th, 2010 There doesn't seem to be a lot of users that help out around here. So I am willing to hang out to help myself out and others if I can. I read where one user thought he found the holy grail of form systems. I have been here for a few days reading like a mad man and I am starting to catch on. I hope I am able in the end to pull off some pretty fancy forms for my sites with what seems to be a fantastic open source app written by Ben. Anyway here are the docs on how to validate the fields http://docs.formtools.org/tutorials/php_validation/ http://docs.formtools.org/tutorials/js_validation/ You can see the validation in the demo files when you download them and look at source. I am not to sure how up to date the demo's are as compared to the new package he just release. So your mileage might vary a little with those demo's. I think it would be great to add all the demo's to the download of formtools so you knew they were up to speed. Billy RE: How do I setup required fields with Form Tools? - SteadmanTech - Oct 1st, 2010 Perfect! Those answered my questions. Thank you! RE: How do I setup required fields with Form Tools? - mrsalvage - Oct 1st, 2010 (Oct 1st, 2010, 6:54 AM)SteadmanTech Wrote: Perfect! Those answered my questions. Thank you! Well no... The dev answered your questions with the killer tut. I just pointed! RE: How do I setup required fields with Form Tools? - drakar - Dec 18th, 2010 Hi I wont to put Really Simple Validation (RSV): Standalone Version in my form. Can some expain hay to Add your form-specific validation code. var rules = []; // this stores all the validation rules rules.push("required,first_name,Please enter your first name."); rules.push("required,email,Please enter your email address."); rules.push("valid_email,email,Please enter a valid email address."); Where to put thet code in page (form) becouse I put end dont work!? Thanks. RE: How do I setup required fields with Form Tools? - Ben - Dec 18th, 2010 Hi Drakar, Yes - exactly. You add that to your form, and then add a onsubmit="rsv.validate(this, rules)" attribute to your form. It's all covered in that tutorial: http://docs.formtools.org/tutorials/js_validation/ Good luck! - Ben RE: How do I setup required fields with Form Tools? - drakar - Dec 19th, 2010 Thanks, on replay Ben. Byt can you please tell my where to put thet code in my form: var rules = []; // this stores all the validation rules rules.push("required,first_name,Please enter your first name."); rules.push("required,email,Please enter your email address."); rules.push("valid_email,email,Please enter a valid email address."); My form: ............................ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript" src="rsv.js"></script> </head> <body> <table width="38%" border="2" cellpadding="0" cellspacing="0" bgcolor="#666666"> <form action="http://test.kavanali.com/formtools/process.php" method="post" enctype="multipart/form-data" onsubmit="return rsv.validate(this, rules)"> <input type="hidden" name="form_tools_form_id" value="2" /> <tr> <td colspan="2" align="right"><div align="left"><strong><font color="#FFFFFF"><br> Vaše ime:</font></strong> <input type="text" name="name"> </div> <div align="left"><br> <font color="#FFFFFF"><strong> Email adresa:</strong></font> <input type="text" name="address"> </div> <div align="left"><br> <font color="#FFFFFF"><strong> Grad:</strong></font> <select name="age" size="1"> <option value="vs">vs</option> <option value="21-30">21-30</option> <option value="31-50">31-50</option> <option value="51-70">51-70</option> <option value="71-100">71-100</option> <option value="Over 100">Over 100?...</option> </select> <br> <br> <font color="#FFFFFF"><strong> Your Age:</strong></font> <input type="radio" name="Pitanje" value="da"> <strong>da</strong> </div> <div align="left"> <input type="radio" name="Pitanje" value="ne"> <strong>ne</strong><br> <br> <font color="#FFFFFF"><strong> Unos:</strong></font> <br> <input type="checkbox" name="unos" value="jedan"> <strong>prvi</strong><br> <input type="checkbox" name="unos" value="dva"> <strong>drugi</strong><br> <input type="checkbox" name="unos" value="tri"> <strong>treci</strong><br> <br> <font color="#FFFFFF"><strong> Slika:</strong></font> <input type="file" name="file"> <br> <br> <font color="#FFFFFF"><strong> Poruka:</strong></font><br> <textarea name="feedback" rows="6" cols="25"></textarea> <br> <br> <input type="submit" value="Poslati"> <input type="reset" value="reset"> <br> <br> </div> </td> </tr> </form> </table> </body> </html> ............................. RE: How do I setup required fields with Form Tools? - Desy231 - Dec 4th, 2017 I'm new to this issue and you helped me. |