1

I'm in a bit of an odd spot here. I am modifying a script, and my validation is all working fine with the exception of my checkbox input selections which are generated from an array with a while loop..

What I need to be able to do is retain the value="checked" if the box has been selected, but the value field currently stores the id value to be passed to a table, and I the value option is how the "checked" is called... So

...PHP_SELF...

while(...)
{
    <input name="seminar[]" type="checkbox" id="seminar[]" value="<?= $data[id] ?>">
}

...SUBMIT...

I am thinking I might need to store the submitted values in an array, then replace the value="<?= $data[id] ?>" with value="checked" but seems kinda wonky to me..

Anyone run into this before have an suggestions?

2
  • Hmmm. My code is not showing up again although I inserted it within the code tags.. Maybe its being moderated?
    – OldWest
    Jan 17, 2011 at 18:24
  • Thanks, Evan. I solved the issue already. It's about the time I lost all my hair, I post up a question and then I find the answer right afterwards! :-)
    – OldWest
    Jan 17, 2011 at 18:29

1 Answer 1

0

I solved this. I did not realize this, but there is an input value titled: checked which works like: checked="checked" .. Geeze this put me in my place : )

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.