<form action="search.php?q=VALUE" type="post" /> <input type="text" id="textbox" name="poster" size="25" /> <input type="submit" class="button" value="Go" /> </form> HTML: I have this form....What I want is for where it says VALUE to change in the forms action to be the same as what is in the textbox. I cant find anything on the internet that will do this seemlessly without the user noticing. By the way Im a complete javascript newbie, so treat me gently
You don't need to do it, if you're doing a POST. The value of the textbox (poster) will be made availabe in the POST variables.
<script type="text/javascript"> function UpdateAction(val) { document.getElementById("myForm").action = "search.php?q=" + val; } </script> <form action="search.php?q=VALUE" id="myForm" type="post" /> <input type="text" id="textbox" name="poster" onchange="UpdateAction(this.value);" size="25" /> <input type="submit" class="button" value="Go" /> </form> Code (markup):