[Javascript] Hyperlinks in forms?

Anthony E. apwebdesign at yahoo.com
Thu Jan 24 11:44:54 CST 2002


Sounds to me you want something like this.....

======================
<body>

<script>
  function send_form(link,form) {
    document.forms[form].link.value = link;
//    alert(document.forms[form].link.value);
    document.forms[form].submit();
  }

</script>

<form name="form1" action="#" method="get">
<input type="hidden" name="link">
<input type="text" name="field1">
</form>

<a href="javascript:send_form('a','0');">link
a</a><br>
<a href="javascript:send_form('b','0');">link b</a>

</body>

===============================================




--- garry taylor <gtaylor at lowebroadway.com> wrote:
> Hello,
> 	I need to have two hyperlinks as part of a CGI
> form, which will 
> call the same perl script but (hopefully) pass which
> link was clicked by 
> the user as part of the query string. Firstly, is it
> possible to have 
> links rather than buttons to do this without over
> complicating my whole 
> site? If this is possible, how can the link be made
> to have a name and a 
> value like a 'submit' button on a CGI form? I'm
> using JavaScript a 
> little in my site but as we may have to make the
> site compatible with 
> older browsers, a non-Javascript solution would be
> good (if possible).
> 
> Thanks a lot!
> 
> Garry taylor
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript


=====
--
Anthony Ettinger
apwebdesign at yahoo.com
415-504-8048
http://chovy.com/resume.doc

__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com



More information about the Javascript mailing list