toolman
1
Hi there,
I have the following url:
http://www.webiste.com/directory/directory/page.html?name=john
What I would like to do is to add the “john” part to the following field, e.g
<input type="hidden" name="agent" value="john">
How would I do this using jQuery?
Thanks!
this field already contains “john”, so I’m not sure what you want to add.
toolman
3
The above was an example of how I would like the input to look. Basically I need to replace or append whatever is in the value attribute.
SamA74
4
Must it be via jQuery?
It’s the sort of thing I would do server-side.
toolman
5
I would need it to be jQuery
// form is your form object. access it according to your HTML code
form.agent.value = location.search.split('=')[1];
system
Closed
7
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.