Remote Validation - get the data of 2+ fields in one remote validation jquery

Support General Remote Validation - get the data of 2+ fields in one remote validation jqueryResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #39343
    justdoit123justdoit123
    Participant

    Hi, i'm trying to get the data of 2+ fields in one remote validation jquery but i'm newbie.

    Please help me or give me some example, so far i tried jquery validate but not works

    
    add_action( 'admin_footer', 'lh_add_livechat_js_code' );
    
    rules: {
        chapter_number: {
            remote: {
                url: "admin-ajax.php?action=validate_chapter_number",
                type: "post",
                data: {
                    chapter_number: function() { // Get chapter_number value
                        return $("#chapter_number").val();
                    },
                    chapter_part: function() { // Get chapter_part value
                        return $("#chapter_part").val();
                    }
                }
            }
        }
    }

    many thanks

    #39354
    PeterPeter
    Moderator

    Hello there,

    You can pass 1 field value to the remote validation for each rule only. Please read more on the documentation to know how to use it https://docs.metabox.io/validation/#remote-validation
    and refer to this topic https://support.metabox.io/topic/remote-validation-example/#post-22957

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.