| Author |
form.action in IE
|
Eduardo Bueno
Ranch Hand
Joined: Jun 04, 2009
Posts: 154
|
|
Hello ranchers,
I have a problem with the DOM form object. I'm trying to change it's action, but I can't get it to work in IE.
This code is inside a function called by a button's onClick event:
It works fine in FF, though.
|
 |
Charbel Keyrouz
Ranch Hand
Joined: Jun 10, 2005
Posts: 46
|
|
|
Show more code please.
|
 |
Eduardo Bueno
Ranch Hand
Joined: Jun 04, 2009
Posts: 154
|
|
I'm using JSP and Servlets. In some of my pages I have this button:
temDisponibilidade is irrelevant since it is with the correct value (true).
Now the JS:
Where Manter.go will go by my servlet. In FF, when the request reaches the servlet, request.getServletPath() is already "/Manter.go", so it will process the business logic and forward to a certain JSP. In IE request.getServletPath() is with the old value ("Reportes.go"), so it will process the current page again. From this I can only presume that IE doesn't recognize form.action property.
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15362
|
|
and what does
look like when you view the page source in IE?
Eric
|
 |
Eduardo Bueno
Ranch Hand
Joined: Jun 04, 2009
Posts: 154
|
|
|
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15362
|
|
and you said it did not work if you did
document.btnIncluir.action = "asdf";
Eric
|
 |
Eduardo Bueno
Ranch Hand
Joined: Jun 04, 2009
Posts: 154
|
|
|
I have no idea what you were trying to say, but I tried that code and it didn't work.
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15362
|
|
Do you have anything named action in your form/page?
Eric
|
 |
Eduardo Bueno
Ranch Hand
Joined: Jun 04, 2009
Posts: 154
|
|
Actually, every form has an action.
http://www.w3schools.com/htmldom/dom_obj_form.asp
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56529
|
|
|
That's not what he asked.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Eduardo Bueno
Ranch Hand
Joined: Jun 04, 2009
Posts: 154
|
|
Sorry, if there is any misregard here please clarify things to me. I still didn't understand what I am doing wrong in the code, neither what he is trying to tell me.
Edit: got the point. There really was a hidden field named action in my JSP, so IE was setting it's value instead of the form's value. Sorry for bothering you guys.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56529
|
|
|
This is a common problem with "action" and "submit". They should never be used as names in HTML form elements.
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15362
|
|
|
 |
 |
|
|
subject: form.action in IE
|
|
|