I geuss, some thing working or not working in JavaScript is a lot dependent
on what version of what browser, are you using.

Well, Any ways, from my previous experience with JavaScript, usually

document.getElementById gives you an object, and casting it to form doesnt
work all the time..

it is always better to use document.forms[i].action .


Thanks and Regards, 
Nitish Kumar 




-----Original Message-----
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
Sent: Monday, June 27, 2005 3:05 AM
To: Struts Users Mailing List
Subject: Re: javascript html:fprm and getElementById


Why do you believe this does not work?  I just tried in IE and it worked 
fine, as I would expect since I do this sort of thing all the time.

I would suggest throwing an alert before and after the code setting the 
action, display what the action of the form is.  I did this and it does 
indeed change.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

Arash Bijanzadeh wrote:
> Hi,
> I need to change the action of my form on the fly. I use the following 
> javascript:
> function setParam(mode)
> {
> document.getElementById("myform").action ="<%=(String)
> request.getAttribute("origin")%>"
> + mode+ ".do";
> document.forms[0].submit();
> 
> }
> and my form is :
> <html:form action="<%=(String) request.getAttribute("origin")%>" 
> styleId="myform" >
> 
> It works perfect under mozilla but not IE. I think the problem is that IE 
> looks for Id in the name field of form and he couln't find it.
> Could anyone help me?
> Regards
> ARash
> 




---------------------------------------------------------------------
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