Submitting the element value in a form automatically updates the URL with the current value for quantity. If you use the onchange event to trigger submit, the URL will not change until the user clicks outside the input:
<form>
<input type="text" name="quantity" size="1" value="1"
onchange="this.form.submit()" />
</form>
Variations of this could look at keyboard events whilst focus is still with the input element. It remains to be seen if reloading the page would be user friendly and it is not clear if this is indeed what you wish to happen. If you don't want to reload the page see the comment and link from @igwan regarding using the history api (check on MDN for browser support).