[Javascript] OK on IE5 for the PC does not work on the IE5.1 on the Mac

Linardo Thorne lthorne at optonline.net
Tue Jan 21 18:04:25 CST 2003


I have asp running fine on IE for the pc however it will not work on the Mac
because of the < > in the JavaScript.

as soon is the script gets to a >< on the Mac if stops compiling the script.

The function in question are the line that contains  (oVal > 100) {

and the tblupdate.outerHTML = "<TABLE ID=tblupdate BORDER=0
WIDTH=590></TABLE>";

I need help bad.

attached is the code.
***********************************

<HTML>
<HEAD>



<script SRC="jsLibrary/jscripts.js" LANGUAGE="JavaScript">
</script>



<title>Online Publication Registration</title>
<link rel="stylesheet" type="text/css" href="style/Search.css">
<link rel="stylesheet" href="style/TableStyle1.css">

<script language="JavaScript1.2">
<!--
function ShowClient() {

	showLayer(0);
	generatecode("regform");
}

function showLayer(Num) {
   	var notFirst = true;

	for(var i = 0; i < 5; i++) {
	    var objName = eval('document.all.div' + i);
		if (objName){
				objName.style.visibility = (i == Num) ? 'visible' : 'hidden';
				objName.style.position = 'absolute';
				objName.style.top = '50px';
				//objName.focus();
		}
	}

	if (notFirst == true) {
		switch (Num) {

		}
	}
	else{
	    notFirst = true;
	}

}

function fo() {
   Form = document.regform;

   for (i=0;i<Form.length;i++)
   {
      if (Form.elements[i].type != "hidden"){
         Form.elements[i].focus();
         break;
      }
   }

   Form.js.value="yes";
   var Op="0";
   if (Op == "yes"){
      Form.elements[0].focus();
   }
}
//-->
</SCRIPT>

<script language="JavaScript1.2">
<!--

function distribution(form,epage1){

   dist.style.visibility = "hidden";

   if (form.elements["xmail"].value == ""      &&
form.elements["xsubscription"].value == "" &&
	   form.elements["xnewsstand"].value == "" &&
form.elements["xbulkcopy"].value == "")
   {
      dist.style.visibility = "visible";
	  form.elements["xmail"].focus();
	  form.elements["xmail"].select();
	  dist.innerHTML = "missing distribution breakdown";
	  epage1 = true;
   }
   else
   {
      var oVal = form.elements["xmail"].value;
	  if (oVal != "") {
         if (isNaN( oVal)) {
            dist.style.visibility = "visible";
            form.elements["xmail"].focus();
	        form.elements["xmail"].select();
	        dist.innerHTML = "pct. mailed value must be numeric";
	        epage1 == true;
	     }
	     else
	     {
	        if (oVal > 100){
	           dist.style.visibility = "visible";
	           form.elements["xmail"].focus();
	           form.elements["xmail"].select();
	           dist.innerHTML = "pct. mailed value can't be greater 100%";
	           epage1 = true;
	        }
	     }
	  }

      var oVal = form.elements["xsubscription"].value;
	  if (oVal != "") {
         if (isNaN( oVal)) {
            dist.style.visibility = "visible";
            form.elements["xsubscription"].focus();
	        form.elements["xsubscription"].select();
	        dist.innerHTML = "pct. subscription value must be numeric";
	        epage1 = true;
	     }
	     else
	     {
	        if ((oVal > 100)){
	           dist.style.visibility = "visible";
	           form.elements["xsubscription"].focus();
	           form.elements["xsubscription"].select();
	           dist.innerHTML = "pct. subscription can't be greater 100%";
	           epage1 = true;
	        }
	     }
	  }

	  var oVal = form.elements["xnewsstand"].value;
	  if (oVal != "") {
         if (isNaN( oVal)) {
            dist.style.visibility = "visible";
            form.elements["xnewsstand"].focus();
	        form.elements["xnewsstand"].select();
	        dist.innerHTML = "pct. news stand value must be numeric";
	        epage1 = true;
	     }
	     else
	     {
	        if (oVal > 100){
	           dist.style.visibility = "visible";
	           form.elements["xnewsstand"].focus();
	           form.elements["xnewsstand"].select();
	           dist.innerHTML = "pct. news stand can't be greater 100%";
	           epage1 = true;
	        }
	     }
	  }

	  var oVal = form.elements["xbulkcopy"].value;
	  if (oVal != "") {
         if (isNaN( oVal)) {
            dist.style.visibility = "visible";
            form.elements["xbulkcopy"].focus();
	        form.elements["xbulkcopy"].select();
	        dist.innerHTML = "pct. bulkcopy value must be numeric";
	        epage1 = true;
	     }
	     else
	     {
	        if (oVal > 100){
	           dist.style.visibility = "visible";
	           form.elements["xbulkcopy"].focus();
	           form.elements["xbulkcopy"].select();
	           dist.innerHTML = "pct. bulkcopy can't be greater 100%";
	           epage1 = true;
	        }
	     }
	  }


	  var ipctTotal = 0;
	  var imail  = form.elements["xmail"].value - 0;
	  var isub   = form.elements["xsubscription"].value - 0 ;
	  var inews  = form.elements["xnewsstand"].value - 0;
	  var ibulk  = form.elements["xbulkcopy"].value - 0;

	  ipctTotal = (imail +  isub + inews  + ibulk);


	  if (ipctTotal > 100)
	  {
	     dist.style.visibility = "visible";
	     form.elements["xmail"].focus();
	     form.elements["xmail"].select();
	     dist.innerHTML = "total pct. distribution can't be greater 100%";
	     epage1 = true;
	  }
   }
   return epage1;
}





More information about the Javascript mailing list