You need to sign in to do that
Don't have an account?
Sadik Shaik 3
When i click on a command link popup window should open on the same page and that should get submitted when onload but i am getting the error "TypeError: document.getElementById(...) is null"
Beloe is my code:
<script type="text/javascript">
function showBox(no) {
var noval= document.getElementById(orderno).innerHTML;
var box = new parent.SimpleDialog("helder"+Math.random(), true);
parent.box = box;
box.setTitle("Details");
box.createDialog();
box.setWidth(1300);
box.setContentInnerHTML("<form method = \"POST\"action=\"https://google.com/\" target=\"orderdetil\"><input type=\"hidden\" name =\"TARGET\" value=\"https://www.w3schools.com/\" /><input type=\"submit\" id=\"clickevent\" value=\"submit\"/></form><input type=\"button\" style=\"background-color:#E01E0F;margin-top: 1px;margin-right: 2px;position:absolute;top:0;right:0;\" value=\"X\" onclick=\"box.hide();\"/><iframe name=\"orderdetail\" src=\"https://www.w3schools.com/\" height=\"500\" width=\"1280\" frameborder=\"0\" style=\"border:none; margin-left:0; margin-right: auto; height:600px;z-index:1;\"></iframe>");
box.setupDefaultButtons();
box.show();
console.log('inside Click Box onload:::');
document.getElementById("clickevent").click();
console.log('hi:::');
document.getElementById("clickevent").style.display = 'none';
}
</script>
Wheni use the id of input in "document.getElementById("clickevent").click();" when i open the popup window i am getting below error "TypeError: document.getElementById(...) is null",
Please anyone help me on this.
Quick response is very helpfull for me. .
Advance in Thanks,
Sadik
<script type="text/javascript">
function showBox(no) {
var noval= document.getElementById(orderno).innerHTML;
var box = new parent.SimpleDialog("helder"+Math.random(), true);
parent.box = box;
box.setTitle("Details");
box.createDialog();
box.setWidth(1300);
box.setContentInnerHTML("<form method = \"POST\"action=\"https://google.com/\" target=\"orderdetil\"><input type=\"hidden\" name =\"TARGET\" value=\"https://www.w3schools.com/\" /><input type=\"submit\" id=\"clickevent\" value=\"submit\"/></form><input type=\"button\" style=\"background-color:#E01E0F;margin-top: 1px;margin-right: 2px;position:absolute;top:0;right:0;\" value=\"X\" onclick=\"box.hide();\"/><iframe name=\"orderdetail\" src=\"https://www.w3schools.com/\" height=\"500\" width=\"1280\" frameborder=\"0\" style=\"border:none; margin-left:0; margin-right: auto; height:600px;z-index:1;\"></iframe>");
box.setupDefaultButtons();
box.show();
console.log('inside Click Box onload:::');
document.getElementById("clickevent").click();
console.log('hi:::');
document.getElementById("clickevent").style.display = 'none';
}
</script>
Wheni use the id of input in "document.getElementById("clickevent").click();" when i open the popup window i am getting below error "TypeError: document.getElementById(...) is null",
Please anyone help me on this.
Quick response is very helpfull for me. .
Advance in Thanks,
Sadik
After your showBox function, before scripts end do this and try. ** If you would have an id field in ur JS then ur code would have worked fine like below. Lets say "clickevent" is the id of a checkbox. Then Your code similar to below will work.
After showbox function only i have tried this but i am getting "document.getelementby is null".
The id i am using from box.setContentInnerHTML in inupt tag.
please help me on this.
Thanks,
sadik