Thanks for the feedback, Real...

The solution I worked up below, targeting .get(0) (first form
on the page), works fine because there is only one form.

But your solution would probably work as well for one form,
but have the added benefit of working for multiple forms.

I'll file you solution away for future use!  :o)

Thanks,

Rick

> -----Original Message-----
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of real
> Sent: Monday, May 05, 2008 1:38 PM
> To: jQuery (English)
> Subject: [jQuery] Re: Way to designate links as form submitters?
> 
> 
> If you're trying to replicate the functionality of a submit button,
> then the link would only submit the form it's contained in. A regular
> submit button wouldn't submit any form (unless I'm mistaken) if it's
> not within the <form> tags anyway. So why not something like this?
> 
> $(document).ready(function(){
> $('a.formlink').click(function(){
> $(this).parents('form').submit();
> return false;
> });
> });
> 
> This way you can have multiple forms on the page if needed.
> 
> On May 2, 12:48 pm, "Rick Faircloth" <[EMAIL PROTECTED]> wrote:
> > Well... the original plan was to use the pagination links
> > on the page to submit the form fields.   That way a user
> > could change the search options and just continue clicking the
> > pagination links instead of "submitting" the new options.
> >
> > However, I believe this might be confusing, so I created a
> > "Click here" link after making option choices to make it clear
> > what the user is supposed to do.
> >
> > And yes, Karl, there's only one form on the page...
> >
> > This solution (it's different than the example submit link I
> > tossed out earlier) is working fine:
> >
> > $(document).ready(function() {
> >         $('.submitLink').click(function() {
> >                 $('form').get(0).submit();
> >                 return false;
> >                 });
> >         });
> >
> > With a text link like this:
> >
> > <p>Uncheck the boxes above to remove those property types from the listings 
> > and click
> > <a class="submitLink" href="<cfoutput>#listlast(cgi.script_name,
> > '/')#?pagenumber=#pagenumber#</cfoutput>">here</a>.</p>
> >
> > So, up to this point, everything's working well.
> >
> > You can see it in action 
> > at:http://c21ar.wsm-dev.com/cfm/browse-properties.cfm
> >
> > Let me know if you have any trouble with it if you decide to check it out.
> >
> > Thanks for all the help!
> >
> > Rick
> >
> > > -----Original Message-----
> > > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of hj
> > > Sent: Friday, May 02, 2008 11:45 AM
> > > To: jQuery (English)
> > > Subject: [jQuery] Re: 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?
> >
> > > Why not mark up the links as buttons, or input type=submit elements,
> > > and then
> > > just use CSS to style them appropriately?
> >
> > > --
> >
> > > hj


Reply via email to