I may be missing something basic but I have a text box in html that I want users to add some text to and when they click a button it is added to the url:
e.g.
<form id="discount_code" action='' method='get'>
<input type='text' name='code' id='code' placeholder='Enter a discount code..'></>
<input type="button" class='small-button' id='useCode' value='Use Code' onClick="parent.location='www.url.com?id=32&code=< TEXT ENTERED HERE >'" />
</form>
is there any way I can get this to work with jQuery change event or similar? I’ve searched and found a number of similar suggestions but nothing seems to work. I need it to be passed to the url in a GET format. It also preferably needs to work in situations where someone pastes the text.
Thanks
GET will automatically put the parameters in the header.
So, if you change the action of your form to http://www.url.com like this:
..This should append whatever is put into code into the the URL. As far as putting id in, you could create a hidden element or another input similar to this: