Problem: sometimes our buttons don’t show up!
We have multiple screen that all have buttons at the bottom of the page. i.e. page forward. page backward, return.
To make the buttons all the same we developed an external script that contains all of the possible buttons. The script is about 9 kb.
The script works great, with one exception sometimes the buttons do not show up!!
The script start out as 11kb. We shrunk the script down in size and there did not seem to be as many errors. But. we are still getting these errors sometimes. Our customer only use Internet Explorer.
I am not sure if the script is to big or what??
How is an external script loaded? what if there are multiple scripts?
here is the code:
var ctr = 1;
var navTbl = “<table width=600> <tr> <td class=’header2′>”;
var tranTbl = “<table align=’center’ border=1 width=300 cellpadding=5 cells
var butnNm = ”;
var keyNm = ”;
var fnctNm = ”;
function createNonTransButtons
(fil,c,en,enn,en1,en1n,b,f,fp,lp,d,r,e,cl,f9,f9n,f10,f10n,f11,f11n,f12,f12
if (c != null){
if (c.toUpperCase() == ‘Y’){
butnNm = “DFH_ENTER”;
keyNm = “Continue”;
fnctNm = “processContinue()”;
wrtNTranLn();
}}
if (en != null){
if (en.toUpperCase() == ‘Y’){
butnNm = “DFH_ENTER”;
keyNm = enn;
fnctNm = “processEnter1()”;
wrtNTranLn();
}}
if (b != null){
if (b.toUpperCase() == ‘Y’){
butnNm = “DFH_PF7”;
keyNm = “Page back”;
fnctNm = “processPageBack()”;
wrtNTranLn();
}}
ChkforBrk();
if (f != null){
if (f.toUpperCase() == ‘Y’){
butnNm = “DFH_PF8”;
keyNm = “Page forward”;
fnctNm = “processPageFwd()”;
wrtNTranLn();
}}
ChkforBrk();
if (lp != null){
if (lp.toUpperCase() == ‘Y’){
butnNm = “DFH_PF4”;
keyNm = “Last page”;
fnctNm = “processLastPage()”;
wrtNTranLn();
}}
ChkforBrk();
if (d != null){
if (d.toUpperCase() == ‘Y’){
butnNm = “DFH_PF11”;
keyNm = “Directory”;
fnctNm = “processDirectory()”;
}}
ChkforBrk();
//** located here for prop & bop use of directory on the enter key
if (en3 != null){
if (en3.toUpperCase() == ‘Y’){
butnNm = “DFH_ENTER”;
keyNm = en3n;
fnctNm = “processEnter4()”;
wrtNTranLn();
}}
ChkforBrk();
//
if (en4 != null){
if (en4.toUpperCase() == ‘Y’){
butnNm = “DFH_ENTER”;
keyNm = en4n;
fnctNm = “processEnter5()”;
wrtNTranLn();
}}
ChkforBrk();
if (f1 != null){
if (f1.toUpperCase() == ‘Y’){
butnNm = “DFH_PF1”;
keyNm = f1n;
fnctNm = “processF1Function()”;
wrtNTranLn();
}}
navTbl += “</td>”;
navTbl += “</tr>”;
navTbl += “</table>”;
navTbl += “<br>”;
navTbl += “<br>”;
document.write(navTbl);
}
function createTransButtons
(fil, EntInq, cmplt, cmpltrvw, sus, susrvw, clr, tosbk, binder){
tranTbl += “<tr><td align=’center’ class=’grey’> “;
tranTbl += “Transaction”;
tranTbl += “<br> “;
if (cmplt != null){
if (cmplt.toUpperCase() == ‘Y’){
butnNm = “DFH_ENTER”;
keyNm = “Complete”;
if (EntInq.toUpperCase() == ‘E’){
fnctNm = ‘processVerify99(“E”,this.form)’
}else{
fnctNm = ‘processVerify99(“I”,this.form)’
}
wrtTranLn2();
}}
tranTbl += “</td>”;
tranTbl += “</tr>”;
tranTbl += “</table>”;
document.write(tranTbl);
}
function wrtTranLn2(){
tranTbl += “<input type=’button’ Name='”;
tranTbl += butnNm;
tranTbl += “‘ value ='”;
tranTbl += keyNm;
tranTbl += “‘ onClick='”;
tranTbl += fnctNm;
tranTbl += “‘>”;
tranTbl += “ ”;
}
function wrtNTranLn(){
navTbl += “<input type=’submit’ Name='”;
navTbl += butnNm;
navTbl += “‘ value ='”;
navTbl += keyNm;
navTbl += “‘ onClick='”;
navTbl += fnctNm;
navTbl += “‘>”;
navTbl += “ ”;
ctr ++;
}
function wrtNTranLn2(){
navTbl += “<input type=’button’ Name='”;
navTbl += butnNm;
navTbl += “‘ value ='”;
navTbl += keyNm;
navTbl += “‘ onClick='”;
navTbl += fnctNm;
navTbl += “‘>”;
navTbl += “ ”;
ctr ++;
}
function ChkforBrk(){
if (ctr > ‘5’){
navTbl += “</td>”;
navTbl += “</tr>”;
navTbl += “<tr>”;
navTbl += “<td class=’header2′>”;
ctr = 1;
}}
I removed some of the redundent code…
Thanks for your help in advance!