<select onchange="select_serviceid();" id="exist_service" name="exist_service" class="validate[required] form-control">
<option value="">Select from existing Service Apartment</option>
<option value="1">test123</option>
<option value="2">Test Provab</option>
<option value="3">Test Provab</option>
<option value="4">Test Provab dated</option>
<option value="5">Test Provab123456789</option>
</select>
<script>
function select_serviceid(){
var select1 = $( "#exist_service option:selected" ).val();
var url = document.URL+'?service='+select1;
$(location).attr('href', url);
}
</script>
Here I redirect the service id to a URL and I reload it, but I want to first check that a parameter is available in current URL. If it's not then I add the parameter, otherwise change the id value only.
This is the URL
http://192.168.0.24/corporate_rooms/CRS/property/service_basicinfo?service=3
parameter service want to changes while on load