I'll bet it'll work with $(this).prev().click().


Phil Oye wrote:
> 
> I want to make an unobtrusive bit of Javascript that will replace all  
> submit buttons with a text link (that I can style) that will submit  
> the form.
> 
> . . . It should just submit the parent form.  
> This is the code that I came up with that doesn't work:
> 
> $(document).ready(function(){
>       
>       $('[EMAIL PROTECTED]').after(" # Button  
> Text ").hide();
>       $('[EMAIL PROTECTED]').next().bind( "click", function() {
>               $(this).prev().submit();
>       });
> });
> 
> 
> 1) The first line creates a the link after any submit buttons, then  
> hides the submit button.
> 2) The second line (theoretically, at least) binds a click event to  
> the newly created link. A click on the link should fire the submit  
> trigger on the previous item, which is the original submit button.
> 
> Line #2 doesn't work. I can bind events to the link, but it will not  
> submit the form. . . .

-- 
View this message in context: 
http://www.nabble.com/Create-text-submit-buttons--tf2888249.html#a8069328
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to