Javascript / browser question
- From: "Thom.Burnett" <Thom.Burnett@xxxxxxxxx>
- Date: 27 Apr 2007 11:05:10 -0700
I want to change an action based on values in a form.
The following javascript code works great in Firefox but not Internet
Explorer.
With IE the default action is always used by submit.
Any ideas why or suggestions on how to get it to work?
Please copy any answer to Thom.Burnett@xxxxxxxxx
<script language="JavaScript" >
function setAction() {
var actionPath=document.mainForm.server.value ;
alert("actionPath is " + actionPath) ;
document.forms[0].action = actionPath ;
document.mainForm.action=actionPath ;
}
</script>
....
<form name="mainForm" action="http://192.168.5.80/cffprod/api/
proc" enctype="multipart/form-data" method="post"
onsubmit="setAction">
<br/>
Enter a container URL. <br/>
The default is for test. <br/>
The standalone uses: http://localhost:8888/apiServlet/proc <br/>
<input type="text" name="server" value="http://192.168.5.80/
cffprod/api/proc" size="60" onchange="setAction()" />
<br/>
.
- Follow-Ups:
- Re: Javascript / browser question
- From: scripts.contact
- Re: Javascript / browser question
- Prev by Date: Adaptive forms
- Next by Date: Re: COOKIE (Javascript/PHP)
- Previous by thread: Adaptive forms
- Next by thread: Re: Javascript / browser question
- Index(es):
Relevant Pages
|