0

I have my form_checkbox and set_value inside a php foreach statement, this line is not working :

form_checkbox(array("name"=>"membershiptype[]","id"=>$membership['name'],
"value"=>$membership['id'], "checked"=>set_radio("membershiptype[]", $membership['id'], 
FALSE)))

I am trying to set up a validation when a checkbox is selected and something else is incorrect to return this value when it comes back to the page and displays an error for something else, right now it is not re-selecting them on validation.

1 Answer 1

1

I fixed my issue by removing the [] in my set_value

form_checkbox(array("name"=>"membershiptype[]","id"=>$membership['name'],
"value"=>$membership['id'], "checked"=>set_radio("membershiptype", $membership['id'], 
FALSE)))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.