I use a text box (stylized to look like a link) when I run into this.
Unlike the link, the text box is ON the form, so I don't need to figure
out what the name or index of the form is.
<input type="text" class="textBoxLink" value="Change"
onclick="DoSubmit(this.form)" size="6"/>
where the javascript function is something like this:
function DoSubmit(frm)
{
frm.submit();
}
and the style matches the link styles on the rest of my site:
.textBoxLink {
color: #3366CC;
font-size: 11px;
font-weight: bold;
font-family: arial;
margin-bottom: 0px;
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
text-decoration: underline;
height: 20px;
border-top: none;
border-left: none;
border-right: none;
border-bottom: none;
background-color: #EEEEEE;
cursor: hand
}
"Guillermo Meyer" <[EMAIL PROTECTED]>
05/05/2004 05:03 PM
Please respond to "Struts Users Mailing List"
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
cc:
Subject: RE: Submit with a link
In struts 1.0, we do as follows to determine formName for situations
like this:
<% String formName =
((org.apache.struts.action.ActionMapping)request.getAttribute(org.apache
.struts.action.Action.MAPPING_KEY)).getName(); %>
This attribute is set in processPopulate method of ActionServlet:
//also pass the mapping through the request
request.setAttribute(Action.MAPPING_KEY,
mapping);
And then:
<a href="javascript:document.forms['<%=formName%>'].submit();return
false;">Dale masa!!</a>
I don't know if in struts 1.1 it will work, but may be you can tell me.
Cheers.
Guillermo.
-----Original Message-----
From: Geeta Ramani [mailto:[EMAIL PROTECTED]
Sent: Mi�rcoles, 05 de Mayo de 2004 05:06 p.m.
To: Struts Users Mailing List
Subject: RE: Submit with a link
Michael:
I think "forms" stands for the list (array?) of all forms in that
document. So the form which appears (physically) first on the document
has index 0, the next one has 1, etc. Is this what you are asking..?
Geeta
> -----Original Message-----
> From: Michael McGrady [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, May 05, 2004 4:08 PM
> To: Struts Users Mailing List
> Cc: Struts Users Mailing List
> Subject: Re: Submit with a link
>
>
> I am a notice in JavaScript. I have wondered in my brief perusal of
> JavaScript books how you tell which form is the referent of
> the formindex
> numbers?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente
a las personas direccionadas en el mail y puede contener informacion (i)de
propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto
profesional. Cualquier opinion en el contenido, es exclusiva de su autor y
no representa necesariamente la opinion de Interbanking S.A. El acceso no
autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking
S.A no asumira responsabilidad ni obligacion legal alguna por cualquier
informacion incorrecta o alterada contenida en este mensaje. Si usted ha
recibido este mensaje por error, le rogamos tenga la amabilidad de
destruirlo inmediatamente junto con todas las copias del mismo,
notificando al remitente. No debera utilizar, revelar, distribuir,
imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el
destinatario. Muchas gracias.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]