I have this code that adds ?prside=5
for example. However, if you change this and the url already is &prside=5
, it just appends it again (&prside=5&prside=40
).
How do i update it instead of appending it, if it's already present?
<select name="prside" onchange="document.location.href = document.location.href + \'&prside=\' + this.value">
<option>Annoncer pr. side</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="40">40</option>
</select>
EDIT: There is other GET variables in the real URL too. And the above script does work, it's just not very pretty with multiple &prside