I want a user to search genenames in a database and return them to the webpage if found. But I also want to give information about that specific gene by creating a link on the webpage with the gene given as input as url parameter.
input example: abi2
<p>Search Gene:</p> <form name = "form1" method="post" action="javascript:jsonfunction();"> <input name="search" type="text" id="search" size="40" maxlength="50"/> <input type="submit" name="Submit" value="Search"/> </form> Rest of the code not included. Now, this is what I would like to get on the webpage:
Gene info: Genecards
(<'a href="http://www.genecards.org/cgi-bin/carddisp.pl?gene=abi2">Genecards ) added ' to show the code.
So far I've found this somewhere on stack...:
<script> function process() { var url="http://www.genecards.org/cgi-bin/carddisp.pl?gene=" + document.getElementById("url").value; location.href=url; return false; } </script> <form onSubmit="return process();"> URL: <input type="text" name="url" id="url"> <input type="submit" value="go"> </form> But this automatically redirects to the new page. I just want it as link on my page.
Thanks in advance :)