I am working with html, javascript, struts1, oracle11, jQuery, spring, tiles, etc... The thing is that I am working with an already built application in which I have been asked to adapt to all browsers including the IE11 version, specific to IE11 because the app only worked properly in IE8 ONLY! neither in chrome nor in firefox nor in more modern versions of IE. The fact is that removing some other style of the application that I have not been able to see correctly, all its functionalities work perfectly except for 4 small things.
In all the windows one of the changes that the browsers asked me for when I debugged through them was that when using getElementById the value entered with a null reference, I went back to using what was used a few years ago, document.all[] and the application goes perfectly, the only ones I can't correct are some like the following:
function pintarTablaLM(){
var url = "/t/ct002_mSelect.do?l=1"
+ "&cod_m=" + document.getElementById('cod_m').value
+ "&v=" + document.getElementById('v_seleccionada').value;
var http = new AW.HTTP.Request;
http.setURL(url);
http.response = function(text){
var cod_l;
var cod_m;
oTableLM.fnClearTable();
while(text.indexOf("|")!=-1) {
cod_l = text.substring(0,text.indexOf("|"));
text = text.substring(text.indexOf("|")+1);
oTableLM.fnAddData([cod_l]);
}
}
http.request();
}
I report, as you can see at the beginning of the function, it takes the value of cod_minitramo using getElementById, with html4 doctype it works correctly, with 5 I get the null reference error, I put all, and the error disappears, but the data does not reach me table.
Perhaps this is not the problem, but I know that everything has become obsolete and it seems bad practice to have to change something modern for something old when what I want is to modernize the application. Any solution or idea of what could be happening friends?
This is the doctype I use for html5<!DOCTYPE html>
EDITING THE COMMENTS:
@rnd This is how I have them in code:
<html:hidden property="cod_m"/> <html:hidden property="v_seleccionada" />
>And this is how they appear in the debugger:<input type="hidden" name="cod_m" value="1"> <input type="hidden" name="v_seleccionada" value="2">
The problem is that the element doesn't have a said
id
but only has thename
, but getElementById doesn't work with the propertyname
.The option in struts is to use
styleId="el_id_aqui"
Try this, and use getElementById
this will result in the html
allowing you to use
getElementById