Login Retreive lost passwordRegister
Search

Forum Index / General / Suggest for new validator

[ This topic is solved ]

  kreatik 17 April 09 / 18:10  
Hi,

it's possible to add new validator based strlen ?

Ex : FH_MINLENGTH15 //15 chars minimum
FH_MAXLENGTH30 //30 maximum...

  Johan Wiegel (Admin) 17 April 09 / 18:29  
how about setMaxLength ?

http://www.formhandler.net/manual/42/SetMaxLength.html

  Johan Wiegel (Admin) 17 April 09 / 19:00  
Changed at 17 April 09 / 19:37
We don't like your solution to give the length argument to the function.

FH is just not designed to give arguments to the validation function.

A better solution is to have 2 functions (maxLength and minLength) in the class TextField.

something like this:
<?php
$oForm
->TextField'test''test'null,null,null,'' );
$oForm->maxLength'test''4' );
$oForm->minLength'test''3' );
?>


if this is what you mean, I can create that for you (sometimes we do requests ;))

  kreatik 17 April 09 / 20:08  
Ok I did not see this function but this function also checks on the server side or only maxlength html tag ?

  kreatik 17 April 09 / 20:09  
Available only for textArea ?

  Johan Wiegel (Admin) 17 April 09 / 20:13  
setmaxlength is only available for a text area, and is just clientside.

  kreatik 17 April 09 / 23:14  
Changed at 17 April 09 / 23:14
Ok, I think it is better to take a server-side as well?

  Johan Wiegel (Admin) 17 April 09 / 23:17  
you are right!

  Top


powered by PHP-GLOBE   © 2004 - 2012 FormHandler. All rights reserved.   -   Open source license