Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 20th, 2004, 10:08 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Can you post the relevant code for the page? E.g. the <head> section with the JavaScript and the <body> section with the attributes and the drop-down?

The whole idea behind onload is that it fires after the page has finished loading. So, when your function is executed because of the onload event, the drop-down list should be in place....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: A marriage made in heaven by Tindersticks (From the album: Donkeys 92-97) What's This?
 
Old May 20th, 2004, 10:11 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hey Clay,

onload is only executed after the page is rendered. If you are creating the select menu dynamically why not call your function after you have done this?

Can you post the code for the whole page?

Regards,

Chris

 
Old May 20th, 2004, 10:20 AM
Friend of Wrox
 
Join Date: Apr 2004
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sure...no problem. I just didn't want an inundation of code thrown at you. Here is the whole page.

<html>

<head>
<title>Alerts Setup</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--



<!--

<!-- hide from JavaScript-challenged browsers

function openWindow(url) {

  popupWin = window.open(url, 'remote', 'menubar=no,toolbar=no,location=no,directories=no, status=no,scrollbars=no,resizable=yes,dependent,wi dth=450,height=350,left=160,top=135')

}

// done hiding -->


<!--
//-->
</script>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
var fIE4orLater = (document.all);
function OpenCHM(sURL)
{
if (fIE4orLater) window.showHelp(sURL);
else window.navigate(sURL);
return;
};

function MM_findObj(n, d) { //v4.01
  var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</SCRIPT>
<link rel="stylesheet" href="../lesson.css">
<script language="VBScript" src="../../3init.vbs"></script>
<script language="VBScript" src="../../3web.vbs"></script>
<script language="VBScript" src="../../3score.vbs"></script>
<script language="JavaScript">
//build variable structure to hold object info to be sent to Eagle
    //declare option type
    var type = "E4W";
    //declare ID multidimensional array to hold E4W IDs and descriptions
    var ID = new Array();

        ID[0] = new Array();
        ID[0][0] = "3308";
        ID[0][1] = "Allow ACTIVANT to receive your alerts as an email";
        ID[0][2] = o3Web.sOptionGet(type,ID[0][0]);

        ID[1] = new Array();
        ID[1][0] = "3326";
        ID[1][1] = "Record 'An iNet Order has been placed' alerts";
        ID[1][2] = o3Web.sOptionGet(type,ID[1][0]);

        ID[2] = new Array();
        ID[2][0] = "3320";
        ID[2][1] = "Record 'QOH has gone to zero' alerts";
        ID[2][2] = o3Web.sOptionGet(type,ID[2][0]);

        ID[3] = new Array();
        ID[3][0] = "3322";
        ID[3][1] = "Record 'QOH has gone negative' alerts";
        ID[3][2] = o3Web.sOptionGet(type,ID[3][0]);

        ID[4] = new Array();
        ID[4][0] = "3321";
        ID[4][1] = "Record 'Backordered item not sourced' alerts";
        ID[4][2] = o3Web.sOptionGet(type,ID[4][0]);

        ID[5] = new Array();
        ID[5][0] = "3323";
        ID[5][1] = "Record 'Release order for picking failed' alerts";
        ID[5][2] = o3Web.sOptionGet(type,ID[5][0]);

        ID[6] = new Array();
        ID[6][0] = "3324";
        ID[6][1] = "Record 'Special Order item received' alerts";
        ID[6][2] = o3Web.sOptionGet(type,ID[6][0]);

        ID[7] = new Array();
        ID[7][0] = "3328";
        ID[7][1] = "Record 'Telecom transmission failed' alerts";
        ID[7][2] = o3Web.sOptionGet(type,ID[7][0]);

        ID = new Array();
        ID[0] = "3330";
        ID[1] = "Record 'Telecom transmission succeeded' alerts";
        ID[2] = o3Web.sOptionGet(type,ID[0]);

        ID[9] = new Array();
        ID[9][0] = "3332";
        ID[9][1] = "Record 'Offline POS Transactions exist' alerts";
        ID[9][2] = o3Web.sOptionGet(type,ID[9][0]);

        ID[10] = new Array();
        ID[10][0] = "3334";
        ID[10][1] = "Record 'Offline Database Refresh failed' alerts";
        ID[10][2] = o3Web.sOptionGet(type,ID[10][0]);

        ID[11] = new Array();
        ID[11][0] = "3336";
        ID[11][1] = "Record 'Gift card activation' alerts";
        ID[11][2] = o3Web.sOptionGet(type,ID[11][0]);

        ID[12] = new Array();
        ID[12][0] = "3338";
        ID[12][1] = "Record 'Allow user-defined reminders' alerts";
        ID[12][2] = o3Web.sOptionGet(type,ID[12][0]);

        ID[13] = new Array();
        ID[13][0] = "3340";
        ID[13][1] = "Record 'buyers signature missing' alerts";
        ID[13][2] = o3Web.sOptionGet(type,ID[13][0]);

        ID[14] = new Array();
        ID[14][0] = "3342";
        ID[14][1] = "Record 'New customer added' alerts";
        ID[14][2] = o3Web.sOptionGet(type,ID[14][0]);

        ID[15] = new Array();
        ID[15][0] = "3344";
        ID[15][1] = "Record 'POS Training Mode started' alerts";
        ID[15][2] = o3Web.sOptionGet(type,ID[15][0]);

        ID[16] = new Array();
        ID[16][0] = "3346";
        ID[16][1] = "Record 'POS Training Mode ended' alerts";
        ID[16][2] = o3Web.sOptionGet(type,ID[16][0]);

        ID[17] = new Array();
        ID[17][0] = "3348";
        ID[17][1] = "Record 'FAX failure' alerts";
        ID[17][2] = o3Web.sOptionGet(type,ID[17][0]);
</script>
<script language="JavaScript">
var ID3308;
function change()
    {
        bOptionSet(type,ID[0][0],frmAlert.opt3308.value);
        bOptionSet(type,ID[1][0],frmAlert.opt3326.value);
        bOptionSet(type,ID[2][0],frmAlert.opt3320.value);
        bOptionSet(type,ID[3][0],frmAlert.opt3322.value);
        bOptionSet(type,ID[4][0],frmAlert.opt3321.value);
        bOptionSet(type,ID[5][0],frmAlert.opt3323.value);
        bOptionSet(type,ID[6][0],frmAlert.opt3324.value);
        bOptionSet(type,ID[7][0],frmAlert.opt3328.value);
        bOptionSet(type,ID[0],frmAlert.opt3330.value);
        bOptionSet(type,ID[9][0],frmAlert.opt3332.value);
        bOptionSet(type,ID[10][0],frmAlert.opt3334.value);
        bOptionSet(type,ID[11][0],frmAlert.opt3336.value);
        bOptionSet(type,ID[12][0],frmAlert.opt3338.value);
        bOptionSet(type,ID[13][0],frmAlert.opt3340.value);
        bOptionSet(type,ID[14][0],frmAlert.opt3342.value);
        bOptionSet(type,ID[15][0],frmAlert.opt3344.value);
        bOptionSet(type,ID[16][0],frmAlert.opt3346.value);
        bOptionSet(type,ID[17][0],frmAlert.opt3348.value);
        switch (sOptionLastStatus())
        {
            case "OK":
                alert("Your change was successful!");
                break;

            case "NA":
                alert("Your change is not allowed. Please try again");
                break;

            case "NB":
                alert("The Eagle Browser is not running. Please sign on to the Eagle Browser.");
                break;
            case "NF":
                alert("This option is not found on the Eagle.");
                break;
            case "NS":
                alert("You do not have security to make this change. Please see your manager");
                break;
            case "NO":
                alert("NO - Unidentified Error");
                break;

            default:
                alert("This is the default message.");
        }
    }
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<body bgcolor="#FFFFFF" link="#336699" onLoad="MM_preloadImages('../../images/prev_r2_c2_f2.gif')" vlink="#336699">
<form name="frmAlert" id="frmAlert" method="get" action="">
<div id="Layer4" style="position: absolute; left: 9px; top: 51px; width: 599px; height: 70px; z-index: 4; visibility: visible">
  <table width="597" border="0" cellpadding="0" cellspacing="2" mm_noconvert="TRUE">
    <tr>
      <td valign="top" height="50">
        <div align="left" class="textsmallbold"> Use this Alerts Options Setup
          table to indicate the specific events for which you want the system
          to generate alerts. While this table turns on the logging of the different
          types of alerts, you must also complete a separate setup process to
          select which users will receive the alerts. </div>
      </td>
    </tr>
    <tr>
      <td class="instxt2" valign="top" width="546">To activate individual alerts,
        select Yes in the &quot;Change Value to...&quot; column of the desired
        alert. Once you have set up all the desired alerts, click the Submit button.
        For more information about an alert, place your mouse over the “info”
        icon at the end of the row. </td>
    </tr>
  </table>
</div>

<div id="Layer1" style="position:absolute; left:10px; top:12px; width:307px; height:23px; z-index:9">
  <table width="307" border="0" cellspacing="0" cellpadding="0">
    <tr>

      <td>
        <div align="left" class="head3">Alerts Options Setup</div>

      </td>

    </tr>

  </table>

</div>

<div id="Layer2" style="position:absolute; left:10px; top:160px; width:385px; height:355px; z-index:10">
  <table width="386" border="2" cellpadding="2" cellspacing="0" bordercolor="#000066" bgcolor="#EBEBEB">
    <tr class="textsmallbold" valign="middle" align="left">
      <td width="191">
        <div align="center">Alert</div>
      </td>
      <td width="54">
        <div align="center">Current Value</div>
      </td>
      <td width="68">
        <div align="center">Change Value to...</div>
      </td>
      <td width="45">
        <div align="center">More Info?</div>
      </td>
    </tr>
    <tr valign="middle" align="left">
      <td class="text_small" width="191"><script language="JavaScript" type="text/JavaScript">
document.write(ID[0][1]);
        </script></td>
      <td width="54" class="text_small">
        <div align="center">
          <script language="JavaScript" type="text/JavaScript">
document.write(ID[0][2]);
          </script>
        </div>
      </td>
      <td width="68"> <div align="center">
          <select name="opt3308" id="opt3308">
            <option value="Y">Yes
            <option value="N">No
            </select>
<script language="JavaScript">
function setChecked(selvalue)
{
    if(ID[0][2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}
onload = setChecked('opt3308');
</script>
        </div>
      </td>
      <td width="45">
        <div align="center"><a href="javascript:;" onMouseOver="MM_setTextOfLayer('infoL','','%3Ctabl e width=%22197%22 height=%22216%22 border=%222%22 cellpadding=%225%22 cellspacing=%220%22 bordercolor=%22#CC0000%22 bgcolor=%22#000066%22%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallboldwhite%22%3EAllow ACTIVANT to receive alerts %0D%0A as an email%3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallwhite%22%3EIf you have iNet, consider setting %0D%0A this option to %3Cb%3EYes%3C/b%3E so that Activant will receive notification via email %0D%0A when your system generates certain critical alerts, such as &amp;quot;backup %0D%0A failed.&amp;quot;%3Cbr%3E%0D%0A %3Cbr%3E%0D%0A Activant is currently developing an infrastructure to respond to these %0D%0A critical alerts. %0D%0A %3Cbr%3E%0D%0A%3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3C/table%3E')" onMouseOut="MM_setTextOfLayer('infoL','','')"><img src="../info_sm.gif" width="22" height="20" border="0"></a></div>
      </td>
    </tr>
    <tr valign="middle" align="left">
      <td class="text_small" width="191"><script language="JavaScript" type="text/JavaScript">
document.write(ID[1][1]);
        </script></td>
      <td width="54" class="text_small">
        <div align="center">
          <script language="JavaScript" type="text/JavaScript">
document.write(ID[1][2]);
          </script>
        </div>
      </td>
      <td width="68"> <div align="center"><select name="opt3326" id="opt3326">
            <option value="Y">Yes
            <option value="N">No
          </select>
          <script language="JavaScript">
function setChecked(selvalue)
{
    if(ID[1][2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}
onload = function(){setChecked('opt3326')};
          </script>
        </div>
      </td>
      <td width="45">
        <div align="center"><a href="#" onMouseOver="MM_setTextOfLayer('infoL','','%3Ctabl e width=%22197%22 border=%222%22 cellpadding=%225%22 cellspacing=%220%22 bordercolor=%22#CC0000%22 bgcolor=%22#000066%22%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallboldwhite%22%3ERecord &amp;quot;An iNet Order has %0D%0A been placed&amp;quot; alerts%3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallwhite%22%3EIf you have iNet, set this option %0D%0A to %3Cb%3EYes%3C/b%3E to generate an alert when an iNet order has been placed %0D%0A by a customer. %3Cbr%3E%0D%0A %3Cbr%3E%0D%0A This alert will help you respond promptly to iNet orders that need to %0D%0A be filled. %3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3C/table%3E')" onMouseOut="MM_setTextOfLayer('infoL','','')"><img src="../info_sm.gif" width="22" height="20" border="0"></a></div>
      </td>
    </tr>
    <tr valign="middle" align="left">
      <td class="text_small" width="191"><script language="JavaScript" type="text/JavaScript">
document.write(ID[2][1]);
        </script></td>
      <td width="54" class="text_small">
        <div align="center">
          <script language="JavaScript" type="text/JavaScript">
document.write(ID[2][2]);
          </script>
        </div>
      </td>
      <td width="68">
        <div align="center">
          <select name="opt3320" id="opt3320">
            <option value="Y">Yes
            <option value="N">No
          </select>
          <script language="JavaScript">
function setChecked(selvalue)
{
    if(ID[2][2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}
onload = function(){setChecked('opt3320')};
          </script>
        </div>
      </td>
      <td width="45">
        <div align="center"><a href="#" onMouseOver="MM_setTextOfLayer('infoL','','%3Ctabl e width=%22197%22 height=%22216%22 border=%222%22 cellpadding=%225%22 cellspacing=%220%22 bordercolor=%22#CC0000%22 bgcolor=%22#000066%22%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallboldwhite%22 height=%2245%22%3ERecord &amp;quot;QOH %0D%0A has gone to zero&amp;quot; alerts%3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallwhite%22%3EWhen you set this option to %3Cb%3EYes%3C/b%3E, %0D%0A the system will generate an alert when the quantity-on-hand of an item %0D%0A has gone to zero. %3Cbr%3E%0D%0A %3Cbr%3E%0D%0A This alert will help you to quickly react to out-of-stock conditions, %0D%0A or identify inaccurate quantities on hand (if you in fact have stock on %0D%0A hand of the alert item).%0D%0A %3Cbr%3E%0D%0A %3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3C/table%3E')" onMouseOut="MM_setTextOfLayer('infoL','','')"><img src="../info_sm.gif" width="22" height="20" border="0"></a></div>
      </td>
    </tr>
    <tr valign="middle" align="left">
      <td class="text_small" width="191"><script language="JavaScript" type="text/JavaScript">
document.write(ID[3][1]);
        </script></td>
      <td width="54" class="text_small">
        <div align="center">
          <script language="JavaScript" type="text/JavaScript">
document.write(ID[3][2]);
          </script>
        </div>
      </td>
      <td width="68">
        <div align="center">
          <select name="opt3322" id="opt3322">
            <option value="Y">Yes
            <option value="N">No
          </select>
          <script language="JavaScript">
function setChecked(selvalue)
{
    if(ID[3][2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}
onload = function(){setChecked('opt3322')};
          </script>
        </div>
      </td>
      <td width="45">
        <div align="center"><a href="#" onMouseOver="MM_setTextOfLayer('infoL','','%3Ctabl e width=%22197%22 border=%222%22 cellpadding=%225%22 cellspacing=%220%22 bordercolor=%22#CC0000%22 bgcolor=%22#000066%22%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallboldwhite%22%3ERecord &amp;quot;QOH has gone negative&amp;quot; %0D%0A alerts%3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallwhite%22%3E When you set this option to %3Cb%3EYes%3C/b%3E, %0D%0A the system will generate an alert when the quantity-on-hand of an item %0D%0A has gone to a negative number. %3Cbr%3E%0D%0A %3Cbr%3E%0D%0A This alert will help you to quickly react to an inaccurate quantity on %0D%0A hand. %3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3C/table%3E')" onMouseOut="MM_setTextOfLayer('infoL','','')"><img src="../info_sm.gif" width="22" height="21" border="0"></a></div>
      </td>
    </tr>
    <tr valign="middle" align="left">
      <td class="text_small" width="191"><script language="JavaScript" type="text/JavaScript">
document.write(ID[4][1]);
        </script></td>
      <td width="54" class="text_small">
        <div align="center">
          <script language="JavaScript" type="text/JavaScript">
document.write(ID[4][2]);
          </script>
        </div>
      </td>
      <td width="68">
        <div align="center">
          <select name="opt3321" id="opt3321">
            <option value="Y">Yes
            <option value="N">No
          </select>
          <script language="JavaScript">
function setChecked(selvalue)
{
    if(ID[4][2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}
onload = function(){setChecked('opt3321')};
          </script>
        </div>
      </td>
      <td width="45">
        <div align="center"><a href="#" onMouseOver="MM_setTextOfLayer('infoL','','%3Ctabl e width=%22197%22 border=%222%22 cellpadding=%225%22 cellspacing=%220%22 bordercolor=%22#CC0000%22 bgcolor=%22#000066%22%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallboldwhite%22%3ERecord &amp;quot;Backordered item %0D%0A not sourced&amp;quot; alerts%3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallwhite%22%3E %0D%0A %3Cp%3EIf you use Order Entry, you should set this option to %3Cb%3EYes%3C/b%3E so %0D%0A that the system will generate an alert whenever an item is backordered %0D%0A but there is no source designated for it. %3C/p%3E%0D%0A %3Cp%3EThis alert will help you avoid leaving backorders in limbo by informing %0D%0A you about backordered items that require action.%3C/p%3E%0D%0A %3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3C/table%3E')" onMouseOut="MM_setTextOfLayer('infoL','','')"><img width="22" height="20" border="0" src="../info_sm.gif"></a></div>
      </td>
    </tr>
    <tr valign="middle" align="left">
      <td class="text_small" width="191"><script language="JavaScript" type="text/JavaScript">
document.write(ID[5][1]);
        </script></td>
      <td width="54" class="text_small">
        <div align="center">
          <script language="JavaScript" type="text/JavaScript">
document.write(ID[5][2]);
          </script>
        </div>
      </td>
      <td width="68">
        <div align="center">
          <select name="opt3323" id="opt3323">
            <option value="Y">Yes
            <option value="N">No
          </select>
          <script language="JavaScript">
function setChecked(selvalue)
{
    if(ID[5][2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}
onload = function(){setChecked('opt3323')};
</script>
        </div>
      </td>
      <td width="45">
        <div align="center"><a href="#" onMouseOver="MM_setTextOfLayer('info2','','%3Ctabl e width=%22197%22 border=%222%22 cellpadding=%225%22 cellspacing=%220%22 bordercolor=%22#CC0000%22 bgcolor=%22#000066%22%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallboldwhite%22%3ERecord %22Release order for picking %0D%0A failed%22 alerts%3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallwhite%22%3E %0D%0A %3Cp%3EIf you use Pick/Pack/Ship, you should set this option to %3Cb%3EYes%3C/b%3E %0D%0A so that the system will generate an alert whenever a clerk attempts %0D%0A to release an order but a condition exists that will not allow it. %3C/p%3E%0D%0A %3Cp%3EThis alert will help you resolve the issue so the order can be released %0D%0A as quickly as possible.%3C/p%3E%0D%0A %3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3C/table%3E')" onMouseOut="MM_setTextOfLayer('info2','','')"><img src="../info_sm.gif" width="22" height="20" border="0"></a></div>
      </td>
    </tr>
    <tr valign="middle" align="left">
      <td class="text_small" width="191"><script language="JavaScript" type="text/JavaScript">
document.write(ID[6][1]);
        </script></td>
      <td width="54" class="text_small">
        <div align="center">
          <script language="JavaScript" type="text/JavaScript">
document.write(ID[6][2]);
          </script>
        </div>
      </td>
      <td width="68"> <div align="center">
          <select name="opt3324" id="opt3324">
            <option value="Y">Yes
            <option value="N">No
          </select>
          <script language="JavaScript">
function setChecked(selvalue)
{
    if(ID[6][2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}
onload = function(){setChecked('opt3324')};
          </script>
        </div>
      </td>
      <td width="45">
        <div align="center"><a href="#" onMouseOver="MM_setTextOfLayer('info2','','%3Ctabl e width=%22197%22 border=%222%22 cellpadding=%225%22 cellspacing=%220%22 bordercolor=%22#CC0000%22 bgcolor=%22#000066%22%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallboldwhite%22 height=%2261%22%3ERecord &amp;quot;Special %0D%0A or Backordered item received&amp;quot; alerts%3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallwhite%22%3E %0D%0A %3Cp%3ESet this option to %3Cb%3EYes%3C/b%3E so the system will generate an alert %0D%0A when an item that is on a special order or backorder has been received. %0D%0A %3C/p%3E%0D%0A %3Cp%3EThis alert will help you get merchandise to your customers as quickly %0D%0A as possible, and will help avoid accidentally putting special/backordered %0D%0A items into stock.%3C/p%3E%0D%0A %3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3C/table%3E')" onMouseOut="MM_setTextOfLayer('info2','','')"><img width="22" height="20" src="../info_sm.gif" border="0"></a></div>
      </td>
    </tr>
    <tr valign="middle" align="left">
      <td class="text_small" width="191"><script language="JavaScript" type="text/JavaScript">
document.write(ID[7][1]);
        </script></td>
      <td width="54" class="text_small">
        <div align="center">
          <script language="JavaScript" type="text/JavaScript">
document.write(ID[7][2]);
          </script>
        </div>
      </td>
      <td width="68">
        <div align="center">
          <select name="opt3328" id="opt3328">
            <option value="Y">Yes
            <option value="N">No
          </select>
          <script language="JavaScript">
function setChecked(selvalue)
{
    if(ID[7][2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}
onload = function(){setChecked('opt3328')};
          </script>
        </div>
      </td>
      <td width="45">
        <div align="center"><a href="#" onMouseOver="MM_setTextOfLayer('info2','','%3Ctabl e width=%22197%22 border=%222%22 cellpadding=%225%22 cellspacing=%220%22 bordercolor=%22#CC0000%22 bgcolor=%22#000066%22%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallboldwhite%22%3ERecord &amp;quot;Telecom transmission %0D%0A failed&amp;quot; alerts%3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallwhite%22%3E %0D%0A %3Cp%3EIf you use telecommunications to transmit your weekly order, or to %0D%0A receive Electronic Receipt Posting (ERP), Electronic File Maintenance %0D%0A (EFM), etc., set this option to %3Cb%3EYes%3C/b%3E so the system will generate %0D%0A an alert whenever a telecommunica-tions transmission fails. %3C/p%3E%0D%0A %3Cp%3EThis alert will help you avoid situations that can adversely affect %0D%0A your business, such as missing your weekly stock order due to an unsuccessful %0D%0A order transmission. With this alert to inform you if the transmission %0D%0A failed, you can resolve the issue and then retransmit. %3C/p%3E%0D%0A %3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3C/table%3E')" onMouseOut="MM_setTextOfLayer('info2','','')"><img src="../info_sm.gif" width="22" height="20" border="0"></a></div>
      </td>
    </tr>
    <tr valign="middle" align="left">
      <td class="text_small" width="191"><script language="JavaScript" type="text/JavaScript">
document.write(ID[1]);
        </script></td>
      <td width="54" class="text_small">
        <div align="center">
          <script language="JavaScript" type="text/JavaScript">
document.write(ID[2]);
          </script>
        </div>
      </td>
      <td width="68">
        <div align="center">
          <select name="opt3330" id="opt3330">
            <option value="Y">Yes
            <option value="N">No
          </select>
          <script language="JavaScript">
function setChecked(selvalue)
{
    if(ID[2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}
onload = function(){setChecked('opt3330')};
          </script>
        </div>
      </td>
      <td width="45">
        <div align="center"><a href="#" onMouseOver="MM_setTextOfLayer('info2','','%3Ctabl e width=%22197%22 border=%222%22 cellpadding=%225%22 cellspacing=%220%22 bordercolor=%22#CC0000%22 bgcolor=%22#000066%22%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallboldwhite%22%3ERecord &amp;quot;Telecom transmission %0D%0A succeeded&amp;quot; alerts%3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallwhite%22%3E %0D%0A %3Cp%3EIf you use telecommunications to transmit your weekly order, or to %0D%0A receive Electronic Receipt Posting (ERP), Electronic File Maintenance %0D%0A (EFM), etc., consider setting this option to %3Cb%3EYes%3C/b%3E so the system %0D%0A will generate an alert whenever a telecommunications transmission succeeds. %0D%0A %3C/p%3E%0D%0A %3Cp%3EThis alert will confirm success, thus eliminating any guesswork about %0D%0A whether or not the vendor received your order. %3C/p%3E%0D%0A %3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3C/table%3E')" onMouseOut="MM_setTextOfLayer('info2','','')"><img src="../info_sm.gif" width="22" height="20" border="0"></a></div>
      </td>
    </tr>
    <tr valign="middle" align="left">
      <td class="text_small" width="191"><script language="JavaScript" type="text/JavaScript">
document.write(ID[9][1]);
        </script></td>
      <td width="54" class="text_small">
        <div align="center">
          <script language="JavaScript" type="text/JavaScript">
document.write(ID[9][2]);
          </script>
        </div>
      </td>
      <td width="68">
        <div align="center">
          <select name="opt3332" id="opt3332">
            <option value="Y">Yes
            <option value="N">No
          </select>
          <script language="JavaScript">
function setChecked(selvalue)
{
    if(ID[9][2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}
onload = function(){setChecked('opt3332')};
          </script>
        </div>
      </td>
      <td width="45">
        <div align="center"><a href="#" onMouseOver="MM_setTextOfLayer('info3','','%3Ctabl e width=%22197%22 border=%222%22 cellpadding=%225%22 cellspacing=%220%22 bordercolor=%22#CC0000%22 bgcolor=%22#000066%22%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallboldwhite%22%3ERecord &amp;quot;Offline POS Transactions %0D%0A exist&amp;quot; alerts%3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallwhite%22%3E %0D%0A %3Cp%3EIf you use Offline POS, you should set this option to %3Cb%3EYes%3C/b%3E so %0D%0A the system will generate an alert when offline POS transactions exist %0D%0A on any of your PCs. That way, you won%27t forget to upload offline transactions %0D%0A to your Eagle server.%3C/p%3E%0D%0A %3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3C/table%3E')" onMouseOut="MM_setTextOfLayer('info3','','')"><img src="../info_sm.gif" width="22" height="20" border="0"></a></div>
      </td>
    </tr>
    <tr valign="middle" align="left">
      <td class="text_small" width="191"><script language="JavaScript" type="text/JavaScript">
document.write(ID[10][1]);
        </script></td>
      <td width="54" class="text_small">
        <div align="center">
          <script language="JavaScript" type="text/JavaScript">
document.write(ID[10][2]);
          </script>
        </div>
      </td>
      <td width="68">
        <div align="center">
          <select name="opt3334" id="opt3334">
            <option value="Y">Yes
            <option value="N">No
          </select>
          <script language="JavaScript">
function setChecked(selvalue)
{
    if(ID[10][2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}
onload = function(){setChecked('opt3334')};
          </script>
</div>
      </td>
      <td width="45">
        <div align="center"><a href="#" onMouseOver="MM_setTextOfLayer('info3','','%3Ctabl e width=%22197%22 border=%222%22 cellpadding=%225%22 cellspacing=%220%22 bordercolor=%22#CC0000%22 bgcolor=%22#000066%22%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallboldwhite%22%3ERecord &amp;quot;Offline Database %0D%0A Refresh failed&amp;quot; alerts%3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallwhite%22%3E %0D%0A %3Cp%3EIf you use Offline POS, you set this option to %3Cb%3EYes%3C/b%3E so the system %0D%0A will generate an alert if the refresh of offline files fails. %3C/p%3E%0D%0A %3Cp%3EYou can then resolve the issue and re-download, thus maintaining the %0D%0A integrity of your offline files. %3C/p%3E%0D%0A %3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3C/table%3E')" onMouseOut="MM_setTextOfLayer('info3','','')"><img src="../info_sm.gif" width="22" height="20" border="0"></a></div>
      </td>
    </tr>
    <tr valign="middle" align="left">
      <td class="text_small" width="191"><script language="JavaScript" type="text/JavaScript">
document.write(ID[11][1]);
        </script></td>
      <td width="54" class="text_small">
        <div align="center">
          <script language="JavaScript" type="text/JavaScript">
document.write(ID[11][2]);
          </script>
        </div>
      </td>
      <td width="68">
        <div align="center">
          <select name="opt3336" id="opt3336">
            <option value="Y">Yes
            <option value="N">No
          </select>
          <script language="JavaScript">
function setChecked(selvalue)
{
    if(ID[11][2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}
onload = function(){setChecked('opt3336')};
          </script>
        </div>
      </td>
      <td width="45">
        <div align="center"><a href="#" onMouseOver="MM_setTextOfLayer('info3','','%3Ctabl e width=%22197%22 border=%222%22 cellpadding=%225%22 cellspacing=%220%22 bordercolor=%22#CC0000%22 bgcolor=%22#000066%22%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallboldwhite%22%3ERecord &amp;quot;Gift card activation&amp;quot; %0D%0A alerts%3C/td%3E%0D%0A %3C/tr%3E%0D%0A %3Ctr%3E %0D%0A %3Ctd valign=%22top%22 class=%22textsmallwhite%22%3E %0D%0A %3Cp%3EIf you activate gift cards on your system, consider setting this option %0D%0A to %3Cb%3EYes%3C/b%3E so the system will generate an alert when a gift card %0D%0A is activated at POS via your ProtoBase credit authorization software. %0
 
Old May 20th, 2004, 10:34 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

You seem to open your JS with quite a few <!--.... mabye this changes something, I don't know.

HTH,

Snib

<><
 
Old May 20th, 2004, 10:36 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Another thing is that you seem to be reassigning the onload so that one or the other function doesn't get called. Try assigning all functions to onLoad the same way (whichever one you choose).

HTH,

Snib

<><
 
Old May 20th, 2004, 11:00 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Wow, you sure do need some cleanup here.

First of all, you're declaring the funcion setChecked many times. This is a waste of CPU and bandwidth, as each function just overwrites the previous one.
Secondly, you're assigning the onload after each select list. So, at the end of the page, all that is called is the setChecked function for the last select list.
Also, the JavaScript is messy at times, especially with all the nested comment tags.

If I were you, I'd try a different approach.

It looks like this page is generated dynamically, using something like ASP, right? If that's the case, with each select list you create, append the ID of the list to a string. Then, at the end of the page, write out that string (with a comma separated list of IDs) that you want to set. e.g.:

setChecked('1234', '2345', '3456')

where the numbers are the IDs of your select lists. Inside the setChecked method, loop through this list and set each list to the value you want.

You could also decide (if possible) to use the selected="selected" attribute on each <option> element you want to select. If at the server you already know what item you must select, this is by far the easiest and quickest way to do it.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old May 20th, 2004, 11:02 AM
Friend of Wrox
 
Join Date: Apr 2004
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried using the body tag suggestion because that seems the easiest, but it did not work. Here is the body tag code...

onLoad="setCheckeda('opt3308');

Here is the setCheckeda function...

<script language="JavaScript">
function setCheckeda(selvalue)
{
    if(ID[0][2] == 'Y')
    {
        document.getElementById(selvalue).selectedIndex = 0;
    }
    else
    {
        document.getElementById(selvalue).selectedIndex = 1;
    }
}
</script>

Anythoughts as to why it does not work? FYI...all the other code is similar to what was originally posted.

Clay Hess
 
Old May 20th, 2004, 11:15 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Clay,

Try out these two simple examples:

http://Imar.Spaanjaars.Com/Demos/Pre...Attribute.html
http://Imar.Spaanjaars.Com/Demos/Pre...wFunction.html

When the page loads, you'll get a JavaScript prompt asking you to type Y or N. Type N, hit enter and you'll see the item gets selected. I used a prompt for the value, instead of using an array, but the idea is the same.

The first page shows how it's done with the <body> onload attribute, the other uses a dynamically generated function. These two examples show the basic principle; after that it's just a matter of putting the pieces together, and adding it your code, hopefully.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Armenia by Einsturzende Neubauten (Track 11 from the album: Zeichnungen Des Patienten O.T.) What's This?
 
Old May 20th, 2004, 11:31 AM
Friend of Wrox
 
Join Date: Apr 2004
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, Imar, Chris, Daniel and Snib for all your help. I am beginning my javascript development career path and everyone on this forum has always been so helpful and encouraging. I truly appreciate it greatly.

I did get the code to work and without error. I took the individual onloads out of the page itself and placed them in the body and I renamed each function that corresponded to each selection. Other than changing the name and removing the onload, they stayed the same. The onload event in the body tag is as follows...

onLoad="setCheckeda('opt3308');setCheckedb('opt332 6');setCheckedc('opt3320');setCheckedd('opt3322'); setCheckede('opt3321');setCheckedf('opt3323');setC heckedg('opt3324');setCheckedh('opt3328');setCheck edi('opt3330');setCheckedj('opt3332');setCheckedk( 'opt3334');setCheckedl('opt3336');setCheckedm('opt 3338');setCheckedn('opt3340');setCheckedo('opt3342 ');setCheckedp('opt3344');setCheckedq('opt3346');s etCheckedr('opt3348');

It worked great and again thanks a lot and if you guys have any other suggestions...feel free to pass them along. I love learning this stuff!

Clay Hess
 
Old May 20th, 2004, 11:36 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Hi Clay,

Do the setChecked*() functions differ somehow?

I ask this question to improve the efficiency of your site (and I'm curious :)).

I'm glad you got it working.

Snib

<><





Similar Threads
Thread Thread Starter Forum Replies Last Post
operation not yet implemented RichardMaly Crystal Reports 11 January 8th, 2013 02:22 PM
Handling isLockedOut isn't implemented Joe@Tulsa BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 April 3rd, 2007 04:06 AM
Ok datagrid implemented however macupryk General .NET 1 October 7th, 2004 11:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.