jQWidgets Forums

This topic contains 3 replies, has 2 voices, and was last updated by  pinho 11 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Success Validation #26439

    pinho
    Member

    Hello there,

    $("#button_confirm").bind('click', function(){
    $('#theForm').jqxValidator('validate');
    $('#theForm').jqxValidator({ onSuccess: function () {
    alert('Just testing');
    }});
    });

    My problem with this little piece of code is that I need to click twice in the ‘button_confirm’ to show the alert message, but I need to validate the form before submiting it (I will handle the information after the form is Success with PHP).

    Any advice? Thanks!

    Success Validation #26449

    pinho
    Member

    I didn’t want to create another post, but I have another problem further than this one.
    How can I say an input text is required and email?

    Because I can only do one of them..

    { input: '#email', message: 'Invalid Email', action: 'keyup, focus', rule: 'email' },

    It’s not required..

    { input: '#email', message: 'Invalid Email', action: 'keyup, focus', rule: 'required' },

    Can be not an email..users can write whatever they want to.

    Success Validation #26450

    Peter Stoev
    Keymaster

    Hi pinho,

    This piece of code should not be in the button’s click handler:

      $('#theForm').jqxValidator({ onSuccess: function () { 
    alert('Just testing');
    }});

    According to me, it should be added to the initialization of the widget.

    Regarding the e-mail – see this sample: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxvalidator/defaultfunctionality.htm?web. The e-mail field is required and the text is required to be e-mail.

    Best Regards,
    Peter Stoev

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

    Success Validation #26560

    pinho
    Member

    It all worked as you said. Thank you!

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

You must be logged in to reply to this topic.