IE 8 hiddenfeild issue
-
Hi, Hi, Below code is working fine in IE6 my aspx page contains below tag <input type="hidden" name="HddElement" /> My javascript is accessing this element like below document.getElementById("HddElement").value = var1; But in IE8 i am getting exception at above line. if i achenged that to below it is working fine. document.all.HddElement=var1; Please let me why this is not working in IE8 with document.getElementById Thanks, Salmon
-
Hi, Hi, Below code is working fine in IE6 my aspx page contains below tag <input type="hidden" name="HddElement" /> My javascript is accessing this element like below document.getElementById("HddElement").value = var1; But in IE8 i am getting exception at above line. if i achenged that to below it is working fine. document.all.HddElement=var1; Please let me why this is not working in IE8 with document.getElementById Thanks, Salmon
Here are two examples of how your code should look ... init = function() { var1="hello"; alert(document.getElementById("HddElement").value) document.getElementById("HddElement").value = var1; alert(document.getElementById("HddElement").value) } init = function() { var1="hello"; f = document.forms[0]; alert(f.HddElement.value) f.HddElement.value = var1; alert(f.HddElement.value) }
-
Hi, Hi, Below code is working fine in IE6 my aspx page contains below tag <input type="hidden" name="HddElement" /> My javascript is accessing this element like below document.getElementById("HddElement").value = var1; But in IE8 i am getting exception at above line. if i achenged that to below it is working fine. document.all.HddElement=var1; Please let me why this is not working in IE8 with document.getElementById Thanks, Salmon
Well for starters your hidden element should look like this: <input type="hidden" name="HddElement" id="HddElement" />
-
Well for starters your hidden element should look like this: <input type="hidden" name="HddElement" id="HddElement" />
http://validator.w3.org/check">http://validator.w3.org/check this validates ... ValidationTest
hi
this gives warning ... ValidationTest
hi
here is the warning ... The sequence can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HTML 4.01 Strict, the '/' terminates the tag '). However, since many browsers don't interpret it this way, even in the presence of an HTML 4.01 Strict DOCTYPE, it is best to avoid it completely in pure HTML documents and reserve its use solely for those written in XHTML.
-
http://validator.w3.org/check">http://validator.w3.org/check this validates ... ValidationTest
hi
this gives warning ... ValidationTest
hi
here is the warning ... The sequence can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HTML 4.01 Strict, the '/' terminates the tag '). However, since many browsers don't interpret it this way, even in the presence of an HTML 4.01 Strict DOCTYPE, it is best to avoid it completely in pure HTML documents and reserve its use solely for those written in XHTML.
Please remember to format (using pre or code tags) any code you include in your post.
I know the language. I've read a book. - _Madmatt
-
Here are two examples of how your code should look ... init = function() { var1="hello"; alert(document.getElementById("HddElement").value) document.getElementById("HddElement").value = var1; alert(document.getElementById("HddElement").value) } init = function() { var1="hello"; f = document.forms[0]; alert(f.HddElement.value) f.HddElement.value = var1; alert(f.HddElement.value) }
Please remember to format (using pre or code tags) any code you include in your posts.
I know the language. I've read a book. - _Madmatt
-
Hi, Hi, Below code is working fine in IE6 my aspx page contains below tag <input type="hidden" name="HddElement" /> My javascript is accessing this element like below document.getElementById("HddElement").value = var1; But in IE8 i am getting exception at above line. if i achenged that to below it is working fine. document.all.HddElement=var1; Please let me why this is not working in IE8 with document.getElementById Thanks, Salmon
Because, you are not supplying the "ID" in the element.
Regards, Nick Kowalewicz Web: www.nk-inc.com