jQuery UI Widgets Forums Plugins Validator, Drag & Drop, Sortable DropDownList Validator

This topic contains 2 replies, has 2 voices, and was last updated by  goksel 11 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • DropDownList Validator #3653

    goksel
    Member

    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.

    DropDownList Validator #3656

    Peter Stoev
    Keymaster

    Hi Peter,

    The validation action is not specified correctly. There’s no valuechanged event in the jqxDropDownList widget. You should use the ‘select’ event instead.

    For example:

                         { input: '#test', message: 'E-mail is required!', action: 'select', rule:
    function (input) {
    return true;
    }
    },

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    DropDownList Validator #3660

    goksel
    Member

    Thanks Peter It has worked.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.