Custom Function for Selectbox

10 views
Skip to first unread message

Kim Quang Đặng

unread,
Jul 14, 2014, 3:31:36 AM7/14/14
to moof...@googlegroups.com

Hi all, 


I posted this issue in Stackoverflow.com. But I also posted here:

I have problem with Mootools formcheck js when applying custom function to Selectbox fieldCustom 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:

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,

Kim Quang Đặng

unread,
Jul 14, 2014, 3:42:33 AM7/14/14
to moof...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages