|
|
|
รบกวนพี่ๆหน่อยค่ะอยากได้โค้ด checkbox เมื่อติ๊ก ยอมรับเงื่อนไง สามารถกดปุ่ม submit ได้ แต่ถ้าไม่ติ้ก ก็จะกดปุ่มsubmit ไม่ได้ |
|
|
|
|
|
|
|
Code (PHP)
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Horizontal form</h2>
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="control-label col-sm-2" for="email">Email:</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="email" placeholder="Enter email">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="pwd">Password:</label>
<div class="col-sm-10">
<input type="password" class="form-control" id="pwd" placeholder="Enter password">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label><input type="checkbox" class="remember"> Remember me</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-success btn-submit" disabled>Submit</button>
</div>
</div>
</form>
</div>
<script type="text/javascript">
$(document).ready(function()
{
$(".remember").click(function()
{
if ($(this).prop("checked") == true)
{
$(".btn-submit").prop("disabled", false);
}
else
{
$(".btn-submit").prop("disabled", true);
}
});
});
</script>
</body>
</html>
|
|
|
|
|
Date :
2016-06-08 08:37:15 |
By :
fossil31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|