Can somebody please, try this code out and tell me how can I makje it working in both browsers. For now it works normaly in IE, but in Netscape it does not ?
I need a solution badly, because the form text element validation is crucial for me. Netscape simply doesn’t work the way I show here. Is the only way for validation would be to use alert() ?
If you simply copy/paste this code, will show exactly what I mean. Please, try it in IE and in Netscape7.2…
<HTML>
<HEAD>
<SCRIPT LANGUAGE=”JavaScript1.1″>
var newWindow = 0
function makeNewWindow(iz) {
if (!newWindow) {
newWindow = window.open(“”,””,”width=300, height=450″)
newWindow.document.write(“<HTML><HEAD><TITLE>Another SubWindow</TITLE></HEAD>”)
newWindow.document.write(“<BODY onBlur=’window.focus()’ bgcolor=’salmon’><H1>Salmon Window</H1>”)
newWindow.document.write(“<H1>”+iz+”</H1>”)
newWindow.document.write(“</BODY></HTML>”)
newWindow.document.close()
} else {
newWindow.close()
}
}
function testTest(iz) {
/* Some validation goes here and if needed start “makeNewWindow”
makeNewWindow(iz)
}
function WinClose() {
if (newWindow) {
newWindow.close()
newWindow = 0
}
}
</SCRIPT>
</HEAD>
<BODY onFocus=”WinClose()”>
<FORM>
<INPUT TYPE=”text” VALUE=”1234″ NAME=”iznos” onBlur=”testTest(iznos.value)”>
<INPUT TYPE=”button” NAME=”newOne” VALUE=”Show new window” onClick=”testTest(iznos.value)”>
</FORM></BODY></HTML>
Thanks for any suggestion, I’m stacked…