So, I have a button to give a direct link to modal in same page.
this is the button and url
<a data-toggle="modal"
href="main_user.php?user_id=<?php echo $user['user_id']; ?>#myModal"
class="btn btn-warning">
( I try to echo the $user_id
on before #modal
) is it right ?
and after I click the button, the modal will appear. This is the modal with the form.
<form class="form-login" action="action/doEditUserStatus.php" method="post">
<div class="login-wrap">
<div class="changestatus">
<p>Banning or Activing User Status</p></div>
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-success active">
<input type="radio" name="options" value="1" autocomplete="off" checked> Actived
</label>
<label class="btn btn-primary">
<input type="radio" name="options" value="2" autocomplete="off"> Banned
</label>
</div>
</div>
<div class="modal-footer">
<button data-dismiss="modal" class="btn btn-default" type="button">Cancel</button>
<button class="btn btn-theme" name="modalSubmit" type="submit">Submit</button>
</div>
</form>
And then I try to submit the modal form, but the action cannot read the $user_id
which I put before #modal
.
UPDATE : Table code :
So this is my table :
<tr class="success">
<th class="numeric">ID</th>
<th class="numeric">E-mail</th>
<th class="numeric">Name</th>
<th class="numeric">Phone</th>
<th class="numeric">Picture</th>
<th class="numeric">Status</th>
<th colspan="2" class="numeric">Action</th>
</tr>
<tr>
<td class="numeric"><?php echo $user['user_id']; ?></td>
<td class="numeric"><?php echo $user['email']; ?></td>
<td class="numeric"><?php echo $user['name']; ?></td>
<td class="numeric"><?php echo $user['phone']; ?></td>
<td class="numeric"><?php echo $user['picture']; ?></td>
<td class="numeric">
<a data-toggle="modal" href="main_user.php?user_id=<?php echo $user['user_id']; ?>#myModal" class="btn btn-warning">
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span> Change Status
</a>
</td>
</tr>
The main problem is :
When I click the button, then the modal will appear but it can't get the $user_id
from that button?