FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I setup required fields with Form Tools?
#1
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!
Reply
#2
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
Reply
#3
Perfect! Those answered my questions. Thank you!
Reply
#4
(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!
Reply
#5
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.
Reply
#6
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
Reply
#7
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>
&nbsp;&nbsp;Vaše ime:</font></strong> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
<input type="text" name="name">
</div>
<div align="left"><br>
<font color="#FFFFFF"><strong>&nbsp;&nbsp;Email adresa:</strong></font>
&nbsp;
<input type="text" name="address">
</div>
<div align="left"><br>
<font color="#FFFFFF"><strong>&nbsp;&nbsp;Grad:</strong></font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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>&nbsp;&nbsp;Your Age:</strong></font>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="Pitanje" value="da">
<strong>da</strong> </div>
<div align="left"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="Pitanje" value="ne">
<strong>ne</strong><br>
<br>
<font color="#FFFFFF"><strong>&nbsp;&nbsp;Unos:</strong></font>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;
<input type="checkbox" name="unos" value="jedan">
<strong>prvi</strong><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;
<input type="checkbox" name="unos" value="dva">
<strong>drugi</strong><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;
<input type="checkbox" name="unos" value="tri">
<strong>treci</strong><br>
<br>
<font color="#FFFFFF"><strong>&nbsp;&nbsp;Slika:</strong></font>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="file" name="file">
<br>
<br>
<font color="#FFFFFF"><strong>&nbsp;&nbsp;Poruka:</strong></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;
<textarea name="feedback" rows="6" cols="25"></textarea>
<br>
<br>
&nbsp; &nbsp;
<input type="submit" value="Poslati">
&nbsp;
<input type="reset" value="reset">
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>
</div>
</td>
</tr>
</form>
</table>
</body>
</html>

.............................

Reply
#8
I'm new to this issue and you helped me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)