helloise Posted January 4, 2011 Share Posted January 4, 2011 i have an html form which is a "post" on it i have an array of checkboxes and a sumbit button, once button is clicked i go to another page where i handle those boxes checked the problem now is if NO checkboxes are checked and i hit the submit...i get errors on the other page my code: foreach($product_names as $product_row) { ?> <tr> <td > </td><td width='200px'><?php echo $product_row->getName(); ?></td> <td width='200px'><input type="checkbox" name="graphic[]" value="<?php echo $product_row->getId();?>" /></td> <td width='200px'><input type="checkbox" name="text[]" value="<?php echo $product_row->getId();?>" /></td> </tr> <?php } ?> </table> <table> <tr> <td> <input type='submit' name='submit' value='Submit'> <?php if ( (isset($graphic)) || (isset($text) )) { echo "checkboxes checked"; //show submit button } else { //hide submit botton and echo "no boxes check"; } ?> the above is NOT working please help???? Quote Link to comment Share on other sites More sharing options...
revraz Posted January 4, 2011 Share Posted January 4, 2011 Posting the errors sure helps Quote Link to comment Share on other sites More sharing options...
helloise Posted January 4, 2011 Author Share Posted January 4, 2011 i fixed it now...but just one last thing when the page opens then obviously no boxes are checked...and i get my message "no boxes check", i want the submit button greyed out then: as soon as i check a box i want the submit button to UN grey i will have to some how loop through graphic[] array but have no clue how can you pls help me wth the code pls? thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.