I am trying to get a value from a select list that will determine what my form method is, either get or post. I am having trouble doing this though. Any suggestions?
<select name ="optionlist" form ="form" id="test">
<option value="get">GET</option>
<option value="post">POST</option>
</select>
<form name="input" action="" method="" id="form">
<input type="text" name="search">
<input name="buttonExecute" type="submit" value="Submit"/>
</form>
JS
function myFunction(input){
alert("You typed in : " + input);
}
function load(){
alert("Page Loaded! This is the current text in the textbox : "+ document.getElementsByName('search')[0].value);
}
func
window.onload = load;
Any help will be greatly appreciated! Thanks!