function getTest()
{
var xmlhttp;
var elt = document.getElementById("selectSub");
var text = elt.options[elt.selectedIndex].text;
sid=document.getElementById("selectSub").value;
window.location.href="addquestion.php?cid="+sid;
}
<!--modal display -->
<select autofocus name="selectSub" id="selectSub" class="form-control"
onchange="getTest();">
on selecting subject function called onchange(). but what happened is when
modal open i select subject and url get changed with subject id and modal
get closed. i want it still opened even after url get changed. please
help.