Login Retreive lost passwordRegister
Search

Forum Index / General / Ajax custom validator on timeField causes JS error

[ This topic is solved ]

  Mark Hampton 17 August 09 / 00:27  
Hello,

Custom ajax validators for timeFields cause a javascript error in prototype.js due to a mismatch between the name of the time field and the name that's passed to the ajax event initiator.

Time fields have two parts (hours and minutes), and both fields can't have the same name. Consequently, FormHandler appends "_hour" to the name of the "hour" field. However, the ajax event is getting the original name without the "_hour". That field name doesn't exist on the form, so javascript throws an error.

Here's the fix for FH3/includes/class.AjaxValidator.php


56a57,61
>     elseif( is_a( $aField[1], 'timeField' ))
>     {
>        $sField .= "_hour";
>        $sEvent = 'blur';
>     }

  Johan Wiegel (Admin) 17 August 09 / 08:49  
Will be added in todays release.

  Top


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