changed behaviour for field "number"?

Questions and bug reports for current release of CKForms

changed behaviour for field "number"?

Postby gogo » Fri Mar 26, 2010 9:33 am

I'm using a field of type "number" to enter postal codes.
For Germany a postal code ist limited to 5 digits.
So i set maximum and minimum length to "5".
As i remember with CKForms 1.3.3 it worked as intended (field has to contain 5 numbers).
With 1.3.4 it tests the value, not the lenght!
So I'm limited to test the value (0 - 99999) or the length (5) without testing for numbers, using field type number or text.

Am i right, that the behaviour changed?
Does anyone has an idea how to test a postal code(only 5 numbers)?

Greetings
GOGO
gogo
 
Posts: 6
Joined: Thu Mar 18, 2010 11:44 am
Top

Re: changed behaviour for field "number"?

Postby popoli » Tue Mar 30, 2010 5:56 pm

I am to the bug for number for the version 1.3.4 :-(
popoli
 
Posts: 2
Joined: Tue Mar 30, 2010 5:53 pm
Top

Re: changed behaviour for field "number"?

Postby popoli » Tue Mar 30, 2010 7:52 pm

If I change line 173 of the file "components/com_ckforms/views/ckforms/tmpl/default.php" :
$validationclass = $validationclass."'digit[".$min.",".$max."]',";
by :
$validationclass = $validationclass."'number[".$min.",".$max."]',";
then is good for zip code.
But I do not know for phone ???
popoli
 
Posts: 2
Joined: Tue Mar 30, 2010 5:53 pm
Top

Re: changed behaviour for field "number"?

Postby rood » Sat Apr 10, 2010 9:26 am

I found this as an error as well, changing the code as mentioned in the post above me did not work for me, the check on what was entered was completely gone
rood
 
Posts: 11
Joined: Sat Apr 10, 2010 9:02 am
Top

Re: changed behaviour for field "number"?

Postby whammock » Tue May 18, 2010 6:41 am

Try this...


I edited componets>views>ckforms>tmpl>default.php around line 198

plugins>content>ckforms.php around line 566

modules>mod_ckforms>tmpl>default.php

find

if ($field->typefield == 'text' && $field->t_texttype == 'number')
{
$validationclass = $validationclass."'digit[".$min.",".$max."]',";


comment out that last line and put these two line in their place


$validationclass = $validationclass."'length[".$min.",".$max."]',";
$validationclass = $validationclass."'number',";


now you can have numbers that have to be a certain length... like zip codes, and phone numbers.
whammock
 
Posts: 14
Joined: Tue May 18, 2010 1:02 am
Top


Return to CKForms 1.3.x Support forum

Who is online

Users browsing this forum: Alexa [Bot] and 2 guests