jQWidgets Forums

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  darkcloudbird 12 years, 2 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • serverside validation #18701

    hi,

    I am trying to implement serverside duplicated names checking,

    my idea is to immediately show the validation error, on blur

    here is the general flow,

    1. user types the name;
    2. custom validation function call dataAdapter.dataBind()
    3. show the validation error if the name already exists.

    here is the piece of validation code

    {
    input : ‘#typeName’,
    message : ‘type already exists’,
    action : ‘blur’,
    rule : function (input) {

    var type = $(‘#typeCode’).val();
    var typeName = $(‘#typeName’).val();
    if(type==” || typeName==”)
    return true;
    else
    {
    var checkLink = ‘/type/checktype/’+type+’/’+typeName;
    typechecksource.url = checkLink;
    typeCheckAdapter.source = typechecksource;
    typeCheckAdapter.dataBind();
    if(isDuplicate==1)
    return false;
    return true;
    }

    }
    },

    The problem is that the dataAdpater can not set the ‘isDuplicate’ variable on-time, even though I set async:false for dataadapter.

    please help if I am going the wrong way.

    Thanks

    serverside validation #18715

    Peter Stoev
    Keymaster

    Hi,

    For server validation, see that sample: http://www.jqwidgets.com/jquery-widgets-demo/demos/php/registration_form.htm?classic. The DateTimeInput’s rule is doing server validation.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    serverside validation #18725

    thanks, that might help

    serverside validation #18726

    thanks working now

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

You must be logged in to reply to this topic.