struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Stone <cityli...@petmystone.com>
Subject Re: <html:link> instead of <html:submit>
Date Fri, 13 Feb 2004 13:49:03 GMT
Paul McCulloch wrote:
> I don't beleve this will submit the values in the form's input fields. I've
> achieved this functionality by having links which use javascript to set the
> dispatch form value & call submit.
> 
> Paul
> 

I was going to say the same thing.

Try something like
	<a href="/page?queryString" onclick="document.formName.submit();return 
false;" onkeypress="return this.onclick()">Submit Query</a>

The HREF provides a non-Javascript browser a backup (section 508, WAI, 
etc). The "return false;" of onclick ensures that the event replaces the 
default behavior of the link, and the onkeypress further meets section 
508, where mouse use is limited or not possible (think non-sighted 
users). I suppose one can do this in a Struts specific manner if desired 
of course. But I'm a Struts newbie.

If anyone wishes to provide the "Struts-way," please do so.

HTH,
Tim


> 
>>-----Original Message-----
>>From: Gopalakrishnan, Jayesh [mailto:Jayesh.Gopalakrishnan@schwab.com]
>>Sent: 12 February 2004 19:45
>>To: Struts Users Mailing List
>>Subject: RE: <html:link> instead of <html:submit>
>>
>>
>>Wouldn't query parameters work here?
>>
>>How abt using <html:link page="/youraction?buttonName=testButton" />
>>
>>
>>HTH..
>>
>>-jayash
>>
>>
>>
>>-----Original Message-----
>>From: Dieter Mummenschanz [mailto:dmummenschanz@gmx.net]
>>Sent: Thursday, February 12, 2004 12:46 PM
>>To: struts-user@jakarta.apache.org
>>Subject: <html:link> instead of <html:submit>
>>
>>
>>Hello,
>>
>>I have a jsp page with some <html:submit> buttons. The 
>>servlet identifies
>>the klicked button by invoking httpservletrequest.getParameter("...").
>>Is there a way to use links in my .jsp page using <html:link> 
>>instead of
>><html:submit>?
>>
>>Thx for any help,
>>Dieter


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


Mime
View raw message