0

I am using codeigniter form validation set_checkbox() function. I would like to keep the checkbox checked which are checked before submission and unchecked which are unchecked before submission. What should I do ??

Thanks

2
  • You want before submission or after submission? I think after submission is your question correct? Commented Dec 20, 2012 at 7:14
  • @somasundaram -- I want after sumission. Commented Dec 20, 2012 at 7:52

1 Answer 1

2

You can use like this

<input type="checkbox" name="mycheck[]" value="1" <?php echo set_checkbox('mycheck[]', '1'); ?> />
<input type="checkbox" name="mycheck[]" value="2" <?php echo set_checkbox('mycheck[]', '2'); ?> />

Please refer this url : http://codeigniter.in.th/user_guide/libraries/form_validation.html

Sign up to request clarification or add additional context in comments.

2 Comments

at the very end of that provided url.
@somasundaram -- I know the above code but my problem is about check and uncheck after submission.

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.