Image

Imagesirstompsalot wrote in Imagephp

Hey guys... I know that this problem isn't exactly PHP, but it does tie into my app.

Right now, I'm writing a permissions system; for this permission system, we are using a multiple select box (no, not an array of checkboxes) to enable the viewing of certain pages:

<select name="content_viewstatuses[]" multiple="multiple" onchange="DoIt();">
<option value="0" selected="selected">-- All --</option>
<option value="1">-- None --</option>
<option value="L">Live</option>
<option value="P">Pending Approval</option>
<option value="U">Under Construction</option>
<option value="D">Disabled</option>
<option value="A">Archived</option>
<option value="R">Up for Review</option>
</select>

We're trying to ensure that if the value of the select is "-- All --" or "-- None --" that the rest of the options are unselected.

Now, I already have my validation of the PHP end, but I'm having a hell of a time validating with some javascript. The problem, I think, is the name. content_viewstatuses[] - No matter what javascript validation I try to do, it always chucks me a wobbly.

I tried doing a google, is it possible that someone here has run into this before...?

-Shade