troubleshooting Question

dynamic creation of different controls based selection in select box values

Avatar of shruti A
shruti A asked on
13 Comments1 Solution244 ViewsLast Modified:
this is  bootstrap code
<span>How do you pass values:</span></th>
   <td><select id="type" class="selectpicker" type="text" style="width:150px"  name="chkPassPort" required="" onSelect="select()">
   <option value="">select</option>
  <option value="Custom Values"  id="chkYes">Custom Values
  <option value=" Static Values"  id="chkNo"> Static Values</option>
<div id="dvPassport" style="display: none">
    Custom Values:
    <input id="value" type="text" placeholder=" Enter Value " name="value" required="" />
<div id="dPassport" style="display: none">
    Static Values:
    <select id="value" class="selectpicker" type="text" style="width:150px" name="value" required="" align="left">
  <option value="">select</option>
  <option value="state">State</option>
  <option value="District">District</option>
  <option value="Gender">Gender</option>
  <option value="B-group">B-group</option>
below is javascript
please help me to solve what i shoud do where i'm going wrong
<script language="javascript" type="text/javascript">
function select()
if(document.form.chkPassPort.value=="Custom Values")
  $("#dvPassport").show() && $("#dPassport").hide();
 $("#dPassport").show() && $("#dvPassport").hide();
Join our community to see this answer!
Unlock 1 Answer and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros