I have a htm page that takes in an entry from the user in an input box.
On the onLoad event i go and check whether the user has a value in for their username and password, passed into from a seperate application.
If they have a valid username and password I set the focus to be the CCI.Input box where the user enters in the CCI number of the printer they want to print to.
On some machines the on load event is not firing. I have found this by using the alert function in the onLoad function on my machine it pops up, on other machines it pops up but in a small handfull it does not pop up.
If i F5 the page it triggers the onLoad event and the CCI input box gets the focus. I am just a bit perplexed as to why on some machines it will not fire.
There is an error popping up saying permission denied and when it is refreshed it gets rid of this.
I am running IE6 on my machine, the machine that it is not working is an IE6 machine.
No way. There are some problem with onload event in FF, but only when the user turns back using the back button. Otherwise, no, as far as I know.
The same browser, on the same Operation System will do always the same things, on different machines.
Post your code HTML and JavaScript (or the relevant part of it) or a link to a test page, and tell us exactly on which browsers onload does not fire. And when.
// ======================================================================
// Script Function: To automatically log into PASWEB System
//
// Requires: AutoIt Version 3.2.12.1 in the form of a registered dll file
//
// Author: Stewart Blair
//
// Created: 10/11/2010
//
// ======================================================================
var username = "<%=Request.username%>";
var password = "<%=Request.password%>";
var patientid = "<%=Request.patientId%>";
var pathToExecutable = "<%=Request.pathToExecutable%>";
var winVersion = "";
function numbersonly(myfield, e, dec)
{
var key;
var keychar;
if (window.event)
key = window.event.keyCode;
else if (e)
key = e.which;
else
return true;
keychar = String.fromCharCode(key);
// control keys
if ((key==null) || (key==0) || (key==8) ||
(key==9) || (key==13) || (key==27) )
return true;
// numbers
else if ((("0123456789").indexOf(keychar) > -1))
return true;
// decimal point jump
else if (dec && (keychar == "."))
{
myfield.form.elements[dec].focus();
return false;
}
else
return false;
}
function checkInternetBrowserVersion(){
var browserName = navigator.appName;
// Test for Microsoft IE browser
if (browserName=="Microsoft Internet Explorer")
{
//var showButton = false;
var appversion = navigator.appVersion.toString();
var listArray = appversion.split(";");
var entryArray;
// loop round appversion
for (var i = 0; i < listArray.length; i++) {
// split up value where possible by a space
entryArray = listArray[i].split(" ");
// test first part of array for MSIE
if (entryArray[1].toUpperCase() == "MSIE") {
// Test the second part for IE version
if (parseFloat(entryArray[2]) == 6 ) {
winVersion = "6";
// everything ok
break;
}
if (parseFloat(entryArray[2]) == 7 ) {
winVersion = "7";
// everything ok
break;
}
}
}
}
//alert(winVersion);
}
function checkusernameandpassword(){
if((username == "") || (password == "")) {
alert("Problem loading Pasweb: check that your username and password are entered in the Clinical Portal My Details Page.");
window.close();
return;
}
document.forms.input.CCI.focus()
}
function CheckValid() {
var CCInumber = document.getElementById('CCI').value
if (CCInumber == "") {
alert("Problem loading Pasweb: You must complete the CCI box. Please Relaunch and Enter Your CCI Number");
document.forms.input.CCI.focus()
<TR>
<td BGCOLOR="#AACCFF"><NOBR>Please Enter Your CCI Number ...<input type="text" name="CCI" id = "CCI" SIZE=4 maxlength="4" onKeyPress="return numbersonly(this, event)" /></NOBR></td>
<td BGCOLOR="#AACCFF"><NOBR><input type="Button" enabled ="false" VALUE="submit" name="SubmitCCI" OnClick="CheckValid()"/> </NOBR></td>
</tr>
</TABLE>
<BR>
<TABLE>
<tr>
<td><FONT COLOR="RED"><B>IMPORTANT: Please enter the correct CCI for your PC. </FONT COLOR></B> </td>
</tr>
<tr>
<td>
<FONT COLOR="RED"><B>A label should be attached to the PC showing this number.</FONT COLOR></B>
</td>
</tr>
<tr>
<td><FONT COLOR="RED"><B>This number determines the printer your PAS labels, letters and OCS request forms are sent to. </FONT COLOR></B></td>
</tr>
<tr>
<td><FONT COLOR="RED"><b>Entering a different CCI number may result in your labels and letters being </FONT COLOR></B></td>
</tr>
<tr>
<td>
<FONT COLOR="RED"><B>printed in a different department/hospital.</FONT COLOR></B>
</td>
My machine is a windows Xp SP3 machine with IE version 6.0.2900.5512
Other test machine is windows xp sp2 with IE version 6.0.2900.2180
Machine not working Win XP sp2 with version 6.0.2900.2180
Although my machine has a diffrent XP sp pack and up to date Browser the 2nd machine is the same as the 3rd and works on the 2nd and not on the 3rd.
I have compared settings and all IE settings are the same accross the board.
If username and password is null then it displays the message Problem loading.......on all machines
If the username and password is not null it does not set the focus of the CCI input box. Only of refreshed does it seem to then set the focus of the input box and will carry on as expected.
Thanks
Am at a loss.
Last edited by Stewart.Blair; 11-12-2010 at 05:57 AM.
Reason: More info...
I don't see any AutoItXDLL object nor a WinClose() method around.
Note. No offense but: For God's sake, how long are you going to use IE6? Even Microsoft makes for about a whole year an appeal to all of you to switch toward at least IE7, if not straight to IE8 or IE9. What' the use of that IE test? A break there? Break what? Returns what?
Bookmarks