struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Barrows" <jbarr...@sssc.com>
Subject RE: Why does <html:submit> work differently than <html:link action="">?
Date Wed, 28 Jul 2004 22:06:29 GMT


> -----Original Message-----
> From: Andrew Close [mailto:aclose@gmail.com]
> Sent: Wednesday, July 28, 2004 2:58 PM
> To: Struts Users Mailing List
> Subject: Re: Why does <html:submit> work differently than <html:link
> action="">?
> 
> 
> ok, my bad. :)
> 
> i tried <html:link forward= /> and <html:link action= /> but not
> <html:link href= />
> 
> next time i'll try 'all' the attributes before posting. ;)

No... just think about what you're doing and understand the technology.  The infinite monkey
approach sucks.

The form is being submitted to wherever the <form says, regardless of method used to submit.
 So, action and forward are entirely inappropriate to use for the link in this case.  They
have nothing to do with the what you want to do, which is submit the form using javascript.
 What was happening, in your case, was the onclick was firing the submit and then you were
being sent to the link,  and things got confused.

Heck you don't even have to use a link for what you want.. you could just as easily use anything
that has the onclick event.  The link tag just gives you the visual cue that this is a link.

> 
> thanks Jim
> 
> andy
> 
> On Wed, 28 Jul 2004 14:50:26 -0700, Jim Barrows 
> <jbarrows@sssc.com> wrote:
> > 
> > 
> > > -----Original Message-----
> > > From: Andrew Close [mailto:aclose@gmail.com]
> > > Sent: Wednesday, July 28, 2004 2:37 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: Why does <html:submit> work differently than 
> <html:link
> > > action="">?
> > >
> > > 
> > >   <a href="#" onclick="submitOne();" >Submit the form 
> with a link</a>
> > 
> > <html:link href="#" onclick="submitOne();">Submit the form 
> with a link</html:link>
> > 
> > does the same thing.
> > 
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message