Hello javascript users, I'm a newby in web programming and i'm wondering if the following can be done. I have a select box in a form with multiple choises and the action of every choise will go to a different url. my question is if it's possible to take along all the pre defined variables to the next url, just like a post method from a form would do. the syntax i have till now is this: <form name='screening' action="http://anewpage" method="post"> <table> <tr valign='baseline'> <td nowrap align='left'>Normal plasma:</td> <td><input type='text' name='rrf_la' size='15'></td> </tr> <tr valign='baseline'> <td align="left" valign="top">Type of assay:</td> <td> <select name='ass_la' WIDTH='150' STYLE='width: 150px' ONCHANGE='location = this.options[this.selectedIndex].value;'> <option value='http://APTT'>APTT</option> <option value='http://DRVVT'>DRVVT</option> </select> </td> </tr> </table> </form> any suggestions would be appreciated, richard mendes
So you are wanting to pass the "rrf_la" variable to the new page "http://DRVVT" for example? Or just redirect to http://DRVVT?
Try something like this: <script language="JavaScript"> <!-- function yourfunction(yourform){ yourform.action = "http://www.newpage.com/page.htm?variable=" + yourform.somevariable.value + ""; return true; } //--> </script> <input type="button" value="Submit" onclick="yourfunction();"> Code (markup):