I have an HTML form which redirects to another website. The thing is I want to change the URL parameters based on select option.
This form when "keyword" is selected, the URL is
https://library.econ.upd.edu.ph/ir/discover?scope=123456789%2F6&scope=&query=web which should be the case. What I want to do is that when option for "Title" and "Author" is chosen, "&scope=" should be omitted.
Can this be achieved with Vanilla Javascript? Jquery would also do. I have yet to read URL params in javascript if this is the way to go in order to achieve what I want to achieve.
<div class="search-form">
<div style="background-color: rgba(255,255,255,0.85);">
<div class="form-group"><b>Search:</b>
<form id="ebscohostCustomSearchBox" class="form-inline" style="overflow: auto;" action="https://library.econ.upd.edu.ph/ir/discover" method="get" target="_blank">
<input id="scope" name="scope" type="hidden" value="123456789/6" />
<select id="delimiter" class="delimiterselect" style="width: 120px; border: 1px solid #540000;" name="scope" size="1" onchange="#">
<option id="keyword" selected="selected" value="">Keyword</option>
<option id="title" value="title&filter_relational_operator_1=contains&filter_1">Title</option>
<option id="author" value="author&filter_relational_operator_1=contains&filter_1">Author</option>
</select>
</div>
<div class="form-group">
<input id="ebscohostsearchtext" class="form-control" style="border: 1px solid #540000;" name="query" size="50" type="text" placeholder="Search for books, articles, databases and more" /></div>
<div class="form-group"><input class="search" style="border: 1px solid #540000;" type="submit" value="SEARCH" /></div>
</form>
</div>
</div>