http://stackoverflow.com/questions/24731412/mootools-formcheck-custom-function-for-selectbox

On Monday, July 14, 2014 2:40:48 PM UTC+7, Kim Quang Đặng wrote:
>
> Hi all,
>
> I posted this issue on stackoverflow, but I also post here
>
> I have problem with Mootools formcheck js when applying custom function
>  to Selectbox field. *Custom Function* will be work fine with *Text Field*, 
> but *Selectbox* is NOT.
>
> My dummy code of Custom Function:
>
> var customFunc = function customFuncF(el) {
>     el.errors.push('Custom function!!!');
>     return false;};
>
> And There are a simple form that I apply to a text field:
>
> [image: enter image description here]
>
> and
>
> <input type="text" class="validate['%customFunc']" id="User_lastName" 
> name="User[lastName]" >
>
> -> It works fine with text field.
>
> But when I apply custom function to Selectbox field, example as Office 
> list in my simple form, it's seems not work and always returns true. My 
> example code for Selectbox
>
> <select id="User_officeId" class="validate['%customFunc']" 
> name="User[officeId]" >
>     <option selected="selected" value="">-Select Office-</option>
>     <option value="1">Office A</option>
>     <option value="2">Office B</option></select>
>
> How can I apply custom function to Selectbox field?
>
> Thanks,
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"MooTools Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to