liquidkrep Posted September 15, 2009 Share Posted September 15, 2009 How can change this code which is multiple select options to checkboxes instead; <fieldset> <legend>Create a contact list</legend> <div> <label for="contacts">Available contacts</label> <span class="input"> <select id="contacts" name="contacts[]" multiple="multiple"> <?php if(!count($contacts)): ?> <option>No emails available</option> <?php else: ?> <?php foreach($contacts as $contact): ?> <option value="<?php echo $contact['recipient_id']; ?>"><?php echo $contact['email']; ?></option> <?php endforeach; ?> <?php endif; ?> </select> </span> </div> </fieldset> Can anyone help me out? Quote Link to comment Share on other sites More sharing options...
seventheyejosh Posted September 15, 2009 Share Posted September 15, 2009 <fieldset> <legend>Create a contact list</legend> <div> <label for="contacts">Available contacts</label> <span class="input"> <?php if(count($contact)<1){ echo 'No emails available'; }else{ foreach($contacts as $contact){ echo '<input type=checkbox value="'.$contact['recipient_id'].'" name="'.$contact['recipient_id'].'" /> '.$contact['email'].'<br />'; }//end foreach }//end if ?> </span> </div> </fieldset> like so? Quote Link to comment Share on other sites More sharing options...
liquidkrep Posted September 15, 2009 Author Share Posted September 15, 2009 I tried this instead; <fieldset> <legend>Create a contact list</legend> <div> <label for="contacts">Available contacts</label> <span class="input"> <?php if(!count($contacts)): ?> <?php else: ?> <?php foreach($contacts as $contact): ?> <input type="checkbox" value="<?php echo $contact['recipient_id']; ?>" name="contacts[]" /><?php echo $contact['email']; ?><br /> <?php endforeach; ?> <?php endif; ?> </span> </div> </fieldset> I think the issue is now that the javascript button will not let me submit the form even though I have the checkbox checked. 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.