Hi Peter,
I have a problem dropdownlist validator.
Ex Code:
…
// Create a jqxDropDownList
$(“#jqxDropDownListDepartment”).jqxDropDownList({ width: ‘200px’, height: ’25px’, theme: theme });
// Load the data from the Select html element.
$(“#jqxDropDownListDepartment”).jqxDropDownList(‘loadFromSelect’, ‘departmentID’);
// selects the first item.
$(“#jqxDropDownListDepartment”).jqxDropDownList(‘selectedIndex’, ‘0’);
$(‘#personelAdd’).jqxValidator({
rules: [
{ input: ‘#personnelName’, message: ‘Personel Name is required!’, action: ‘keyup, blur’, rule: ‘required’ },
{ input: ‘#personnelName’, message: ‘Your username must be between 3 and 12 characters!’, action: ‘keyup’, rule: ‘length=3,12’},
{ input: ‘#departmentID’, message: ‘Zorunlu alandır.’, action: ‘keyup, blur,valuechanged’, rule: function () {
var index = $(“#jqxDropDownListDepartment”).jqxDropDownList(‘getSelectedIndex’);
if (index)
{
return true;
}
else
{
alert(index);
return false;
}
}}], theme: theme
});
This code dose not work. Where is the problem ?
Thanks Peter.