A location.search string will be formatted according to certain rules. For instance, every specific variable contained in the string will be a statement in itself, separated from each other by ampersand "&" characters. Therefore, we can split the location.search string into an array of strings, like this:
mySearch = location.search.substr(1).split("&")
This creates an array of objects named mySearch. Each will look like this:
myValue=AEIOU
From this, we can use a for loop and eval statements to set certain values of the form:
function getFromSearch() { var x = 0 mySearch = location.search.substr(1).split("&") for (x=0;x<=mySearch.length;x++) { eval("document.forms.myNewForm."+mySearch[x]) } }
The results of this should be displayed in the text box below.