Tim, I keep on getting the value of the "action" field when I try your
solution.

I guess the best solution would be changing the "action" field name to
"whichAction" or something.

Thanks especially you and everyone for helping!!!!!

Julio


-----Mensaje original-----
De: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED] 
Enviado el: Martes, 09 de Marzo de 2004 05:20 p.m.
Para: 'Struts Users Mailing List'
Asunto: RE: people using action form field

> Ok, let me show what I'm trying to do, imagine that this is 
> the HTML code rendered by struts:
 
> <form name="elementForm" action="/getElements.do">
>       <input type="hidden" name="action" value="Create">
> </form>
 
> Now, when I try to change the value of 
> ..action="/getElements.do".. using javascript , 
> document.elementForm.action = '/newGetElements.do', this 
> refers to the field that has the Create value instead of the 
> action element in the form tag (<form name="elementForm" 
> action="/getElements.do">).

So you're trying to change the value of the "action" attribute of the
"<form...> tag? Then my first post was right: assign an id= attribute to
the
"<form..>" tag (using the styleId attribute of the Struts <html:form...>
tag), then use document.getElementById() to find the form tag. So you
have:

<form action="something.do" id="xxxx">

Which might come from the Struts tag:

<html:form action="something.do" styleId="xxxx">


Then your JavaScript would look like this:

document.getElementById("xxxx").action="somethingelse.do";

That can only assign a new value to the action attribute of the <form..>
tag, it can't possibly address the hidden text field.

--
Tim Slattery
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to