Follow us on

Codestar Support Forum » WordPress Plugins » Codestar Framework

Bug - validate not working in widget !

  1. Hi,
    I just find another bug about the validate Email, Numeric and Url are not working in widget options.

    array(
                'id'            => 'email_address',
                'type'          => 'text',
                'validate'      => 'shipo_validate_email',
                'title'         => esc_html__('Email Address', 'shipo'),
                'dependency'    => array( 'contact_info_ctr', '==', 'true' ),
            ),
            array(
                'id'            => 'phone_number',
                'type'          => 'text',
                'validate'      => 'shipo_validate_numeric',
                'title'         => esc_html__('Phone Number', 'shipo'),
                'dependency'    => array( 'contact_info_ctr', '==', 'true' ),
            ),CopyCopied!

    Screenshot -> https://i.postimg.cc/NF18095z/screenshot-226.png

    Thanks

    Posted 3 years ago #

  2. Codestar
    Admin

    Hi,

    Uh, Widget Framework doesn't support validate. Because It's saves data with AJAX Request. I should to write a lot of js code for compatible it. Maybe In the future. I have noted this for you. When I have free-time, I'll work on it.

    Btw, You can write by yourself simple custom JS Code for check it.

    Regards, Codestar

    Posted 3 years ago #
  3. Okay No Problem
    Thanks

    Posted 3 years ago #

  4. Codestar
    Admin

    Thanks for understanding

    Posted 3 years ago #
  5. how to validated the phone number?

    Update

    think I have solved this issue

    array(
    'id' => 'phone',
    'type' => 'text',
    'title' => 'Phone',
    'sanitize' => 'csf_validate_numeric'
    ),

    Posted 10 months ago #

  6. Codestar
    Admin

    Hi @basudevkunwar,

    Yes, It's correct way.

    Regards, Codestar

    Posted 10 months ago #