i'm using this code to get the email addresses of the users from the data base for an email page. without submitting the form is there a way to select the email addresses and fill up the to field in the email form???? the code part that i used to get the values for the check box is :
<form>
<?php $email="";
if ($result->num_rows > 0) {
// output data of each row
while($cat = $result->fetch_assoc()) { ?>
<tr>
<td><input type="checkbox" name="user" value="<?php echo $cat['email']); ?>" oncheck="<?php $email .= $cat['email'] .','; ?>"></td>
<td><?php echo ($cat['name']); ?> (<em><?php echo ($cat['email']); ?></em>)</td>
</tr>
<?php }
} ?>
</form>
and the code bit where the form that i assign the values are
<div class="6u 12u(3)">
<input type="email" name="email" id="email"
<?php if($email==""){ ?>
placeholder="Email" <?php }
else { ?> value="<?php echo $email; ?>"
<?php } ?> />
</div>
but the email address picks up the emails from all the check boxes on form load it self... can some one please help me on this... tried all possibles ways and now i'm lost with it.
many thanks
Aucun commentaire:
Enregistrer un commentaire