Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    what code are you using for a custom field? the code below seems to allow to make the checkbox field required

    $form["field"][] = array(
            "name" => "my_custom_checkbox",
            "type" => "adverts_field_checkbox",
            "order" => 25,
            "label" => "Custom Checkbox",
            "is_required" => true,
            "validator" => array( array( "name" => "is_required" ) ),
            "max_choices" => 2,
            "options" => array(
                array("value"=>"1", "text"=>"One"),
                array("value"=>"2", "text"=>"Two"),
            )
        );
    Thread Starter Eve

    (@etransac)

    thanks now its working! i use “type” instead of “name”

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom Checkbox Make Require’ is closed to new replies.