newhck / php-form-builder-class

Automatically exported from code.google.com/p/php-form-builder-class
GNU General Public License v3.0
0 stars 0 forks source link

equalTo Validation and Number Only Input Field #66

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This is the Modified Code and the Dependency for the Number Only Field.

USAGE:

Number Only Field:

$form->addTextbox("Amount:", "Amount", "", array("required" => 1, "numeric" => 
1));

to allow negative integer, use it this way,

$form->addTextbox("Amount:", "Amount", "", array("required" => 1, "numeric" => 
1, "allowNegative" => true));

equalTo:

First Field:
$form->addPassword("Password:", "Password", "", array("required" => 1, 
"postHTML" => '<div style="font-size: 11px;">Must Be Greater Than 2 
Characters</div>'));

Second Field:
$form->addPassword("Re-Enter Password:", "Password2", "", array("required" => 
1, "equalTo" => 'Password'));

The jquery.jField.js Plugin is responsible for the Number Only Field.

Send any comment to geodavis2007@gmail.com

Original issue reported on code.google.com by geodavis...@gmail.com on 3 Aug 2010 at 4:22

Attachments:

GoogleCodeExporter commented 8 years ago
This is not a defect but an Enhancement

Original comment by geodavis...@gmail.com on 5 Aug 2010 at 9:11

GoogleCodeExporter commented 8 years ago
Hi,

This is great, although its quite restrictive, often you dont want to test 
against just being equal to something, but match a regex or something else like 
that.

For example like in my issue at ->
http://code.google.com/p/php-form-builder-class/issues/detail?id=47

Perhaps it is quite easy to update your modifications to meet what I proposed 
in my issue.

Of course this functionality is better then nothing, unfortunately I haven't 
looked over your patch yet... so sorry about that. 

We will see what Andrew thinks... :P

Original comment by moncojhr@gmail.com on 5 Aug 2010 at 12:35

GoogleCodeExporter commented 8 years ago
Thanks moncojhr, what I really did was to verify two form fields that must have 
equal value, not type validation.

Thanks

Original comment by geodavis...@gmail.com on 6 Aug 2010 at 8:12

GoogleCodeExporter commented 8 years ago
r350 now includes a two new element attribues - integer and alphanumeric - that 
can be used to validate numbers only and numbers and/or letters respectively.

Original comment by ajporterfield@gmail.com on 4 Sep 2010 at 5:42