Click to See Complete Forum and Search --> : Javascript: Submitting form with multiple text links


kanuj
04-12-2006, 02:26 AM
I've a form with multiple radiobutton entries and at the bottom of the form are three functions that operate on the selected radiobutton field. I could use the following code I found, to work with a single "text link form submit", but what do I do for 3 different submits? Each different text link performs a different function. Do I make three different Javascript functions like this one below? Also, how do I pass the value of the field that is in the radiobutton? Each field that appears has a hidden variable that I wish to pass to each of these functions.

The JS function:

<script language="JavaScript" type="text/javascript">
<!--
function getsupport ( selectedtype )
{
document.supportform.supporttype.value = selectedtype ;
document.supportform.submit() ;
}
-->
</script>

The hidden input reqd. for text link form submission:

<input type="hidden" name="supporttype" />

The link itself:

<a href="javascript:getsupport('Paid')">Link Function</a>

Thanks.

Weedpacket
04-20-2006, 06:06 AM
Use a different value for selectedtype when you call the getsupport() function in the link, and in the getsupport() function work out what to do based on the value of selectedtype.