Rick,

Try this (untested):

$(document).ready(function() {
    $.each(".formlink"), function() {
       $(this).click(function() {
          $("#supporttype").val($(this).attr("id");
          $("#supportform").submit();
       });
    });
});

<form id="supportform" name="supportform" method="post" 
action="yourscriptname.cgi">

<input type="hidden" id="supporttype" name="supporttype" />
<a class="formlink" id="Paid">Paid Support</a> or
<a class="formlink" id="Free">Free Support</a>

HTH,
Carl

Rick Faircloth wrote:
> As a follow-up to my question, I found this method
> that utilizes regular JS, but I'd like to be able to
> cause any link with a certain id to act as a "Submit Link".
>
> Here's the code I found to create a text submit link:
>
> <script language="JavaScript" type="text/javascript">
> <!--
> function getsupport ( selectedtype )
> {
>   document.supportform.supporttype.value = selectedtype ;
>   document.supportform.submit() ;
> }
> -->
> </script>
>
> <form name="supportform" method="post" action="yourscriptname.cgi">
>
> <input type="hidden" name="supporttype" />
> <a href="javascript:getsupport('Paid')">Paid Support</a> or
> <a href="javascript:getsupport('Free')">Free Support</a>
>
> Thanks for any help in changing this to jQuery!
>
> Rick
>
>
>
>   
>> -----Original Message-----
>> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rick 
>> Faircloth
>> Sent: Thursday, May 01, 2008 12:08 PM
>> To: jquery-en@googlegroups.com
>> Subject: [jQuery] Way to designate links as form submitters?
>>
>>
>> Anyway to do that?
>>
>> Have certain links, say with an id of "link",
>> to be programmed to submit a form when clicked?
>>
>> Rick
>>
>>     
>
>
>
>
>   

Reply via email to