我希望获得<div class="main">
<div class="login-back-up">
</div>
<div class="login-back-down">
<p class="buttons-row hr-login-button-row">
<a href="#" class="button">Button</a> <!--I change it to Button because that-->
<a href="#" class="button">Button</a> <!--is on picture of example from OP-->
</p>
</div>
</div>
个按钮值,以通过向用户显示确认模式来确认用户的信息。
按钮:
clickMe
PHP:
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<button type="submit" class="btn btn-primary" value="clickMeValue" name="clickMe">Click Me</button>
</form>
如何在bootstraps模态中获得<?php
if (isset($_POST['clickMe'])){
echo "<script>$(document).ready(function(){
$('#confirmModal').modal('show');
});</script>"; // showing modal from php
//after shoeing modal from php
if(isset($_POST['confirm'])){
echo $_POST['confirm'];
echo "<br/>";
echo $_POST['clickMe']; //this is not echoing
}
}
?>
值确认。
答案 0 :(得分:0)
为按钮添加ID,然后您可以在此处访问所单击按钮的值..
<button type="submit" id="my-button" class="btn btn-primary" value="clickMeValue" name="clickMe">Click Me</button>
然后..
$(document).ready(function() {
$('#my-button').click(function() {
var the_value = $(this).val();
alert(the_value);
});
});