Checkbox checked by default
-
Hi, I am using PMPro Register Helper to add fields to checkout. I am trying to add a few checkboxes for users to select their interests. They are displaying correct on the page and they are displaying in the backend admin page, but the only problem is that even if a user only checks one box all are checked in their profile in the backend. Have I formatted checkboxes incorrectly? Here’s the code:
$fields[] = new PMProRH_Field( "interests", // input name, will also be used as meta key "checkbox", // type of field array( "text"=>"Swimming", "class"=>'interests', "profile"=>true // show in user profile )); $fields[] = new PMProRH_Field( "interests", // input name, will also be used as meta key "checkbox", // type of field array( "text"=>"Running", "class"=>'interests', "profile"=>true, // show in user profile "showmainlabel"=>false )); $fields[] = new PMProRH_Field( "interests", // input name, will also be used as meta key "checkbox", // type of field array( "text"=>"Cycling", "class"=>'interests', "profile"=>true, // show in user profile "showmainlabel"=>false )); $fields[] = new PMProRH_Field( "interests", // input name, will also be used as meta key "checkbox", // type of field array( "text"=>"Triathlon", "class"=>'interests', "profile"=>true, // show in user profile "showmainlabel"=>false ));
Thanks in advance!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Checkbox checked by default’ is closed to new replies.