"on Click select option then hide, show and change details"
Bootstrap 3.3.0 Snippet by naimansari

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="row">
<h2>Create your snippet's HTML, CSS and Javascript in the editor tabs</h2>
</div>
<select id="options" onchange="optionCheck()">
<option></option>
<option value="show">Show Div</option>
<option value="goto">Go To Google</option>
</select>
<div id="hiddenDiv" style="height:100px;width:300px;border:1px;visibility:hidden;">
I am visible now!</div>
</div>
<form name="" method="post" action="register-online-pdf.php">
<div class="col-sm-12 form-group">
<select name="payment_type" id="payment_type" onchange="optionCheck()" class="form-control select-insurance-information">
<option>--Select Payment Type *--</option>
<option value="self-pay"> Self Pay </option>
<option value="self-pay2"> Self Pay 2 </option>
<option value="self-pay3"> Self Pay 3</option>
<option value="insurance"> Insurance </option>
</select>
</div>
<div id="insurance-information">
<div class="col-sm-12">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
#insurance-information { display:none;}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function optionCheck(){
var option = document.getElementById("options").value;
if(option == "show"){
document.getElementById("hiddenDiv").style.visibility ="visible";
}
if(option == "goto"){
window.location = "http://google.com";
}
var option = document.getElementById("payment_type").value;
if(option == "insurance"){
document.getElementById("insurance-information").style.display ="block";
}
if(option == "self-pay"){
document.getElementById("insurance-information").style.display ="none";
}
if(option == "self-pay2"){
document.getElementById("insurance-information").style.display ="none";
}
if(option == "self-pay3"){
document.getElementById("insurance-information").style.display ="none";
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: