Fetching Query string value using javascript:
$("#btnschoolsearch").click(function () {
var u = $('#txtstate').val();
var p = $('#ddldistrict').val();
var q = $('#dropschooltype').val();
if (p == "Select District")
p = " ";
if (u == "Enter state")
u = " ";
if (q == "Select School Type")
q = " ";
window.location="../School/SchoolSerch?district="+p+"&state="+u+"&schooltype="+q;
});
<script>
$(document).ready(function () {
var s = window.location.href;
var id = s.match(/district=([^&]+)/)[1]
var state = s.match(/state=([^&]+)/)[1]
var schooltype = s.match(/state=([^&]+)/)[1]
alert(schooltype);
});
</script>
$("#btnschoolsearch").click(function () {
var u = $('#txtstate').val();
var p = $('#ddldistrict').val();
var q = $('#dropschooltype').val();
if (p == "Select District")
p = " ";
if (u == "Enter state")
u = " ";
if (q == "Select School Type")
q = " ";
window.location="../School/SchoolSerch?district="+p+"&state="+u+"&schooltype="+q;
});
$(document).ready(function () {
var s = window.location.href;
var id = s.match(/district=([^&]+)/)[1]
var state = s.match(/state=([^&]+)/)[1]
var schooltype = s.match(/state=([^&]+)/)[1]
alert(schooltype);
});
</script>
Sign up here with your email
ConversionConversion EmoticonEmoticon