Required Validation Not Working

Support General Required Validation Not WorkingResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #19605
    ossama saeedossama saeed
    Participant

    Hi Guys,
    I am trying to use the required validation, but it did`t work. it only show the red * . can you help me ?

    $meta_boxes[] = array(
            'title'      => 'Country Code',
            'taxonomies' => 'country-code',
            'fields' => array(
                array(
                    'name'  => 'dial-code',
                    'id'    => 'dial-code',
                    'type'  => 'number',
                    'desc'  => 'enter the country dial code e.g. +20',
                    'required'  => true,
                )
            ),
        );
    

    Thanks in advanced,

    #19612
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Could you please update the latest version of Meta Box plugin to v5.3.0 and MB Term Meta to v1.2.9 then check the issue again?

    Here is my sample code

    add_filter( 'rwmb_meta_boxes', 'add_field_taxonomy' );
    function add_field_taxonomy( $meta_boxes ) {
        $prefix = '';
        $meta_boxes[] = array (
            'title' => esc_html__( 'Taxonomy field', 'text-domain' ),
            'id' => 'taxonomy-field',
            'fields' => array(
                array (
                    'id' => $prefix . 'text_m0ijcp97ay',
                    'type' => 'text',
                    'name' => esc_html__( 'Text Field1', 'text-domain' ),
                    'required' => 1,
                ),
            ),
            'taxonomies' => 'category',
        );
        return $meta_boxes;
    }

    and it works as well on the post category settings page, see my screenshot https://cl.ly/56fc0ebfce18

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