[Javascript] Limits to string length in Firefox?!?

Liam Rice Liam.Rice at autodata.net
Tue Jun 13 11:14:50 CDT 2006


Hi there, I've got an issue with what appears to be a limit to the
length of a string in Firefox.  It loops through the array of checkboxes
from another frame just fine, but it seems to kill the string (sRegions)
that I am building when it's about half way through the list.  The
string seems to be okay in IE.  Any help would be appreciated.  Thanks

function getArguments() {
  var sEffectiveFrom = '1/1/1970';
  var sEffectiveTo = '1/1/2099';
  var sPostedFrom = '1/1/1970';
  var sPostedTo = '';
  var sDivisions = '';
  var sPrevDivision = '';
  var sRegions = '';
  var sYears = '';
  var sTypes = '';
  var sNational = 'F';
  
  for (var i=0; i<window.frames[2].document.forms["frmDivs"].length;
i++) {
    if (window.frames[2].document.forms["frmDivs"][i].type == 'checkbox'
&& window.frames[2].document.forms["frmDivs"][i].checked) {
      if
(window.frames[2].document.forms["frmDivs"][i].name.indexOf("reg_") >=0)
{
        aRegName = window.frames[2].document.forms["frmDivs"][i].name;
        aRegName = aRegName.split("_");
 
//console.info(window.frames[2].document.forms["frmDivs"][i].name);
        //console.info('div' + aRegName[1] + ':: region::' +
aRegName[2]);
        if (aRegName[1] != sPrevDivision) {
          sDivisions += '"' + aRegName[1] + '",';
          sPrevDivision = aRegName[1];
        }
        if (aRegName[2].length > 0) {
          sRegions += '"' + aRegName[2] + '",';
        }
        console.info('array::' + aRegName[2]);
        console.info('region::' + sRegions);
        //console.info(typeof(aRegName[2]));
      }
    }
  }
  
  for (var i=0; i<window.frames[0].document.forms["frmMain"].length;
i++) {
    switch (window.frames[0].document.forms["frmMain"][i].name) {
      case 'txtEffective1':
        if (window.frames[0].document.forms["frmMain"][i].value != '') {
          sEffectiveFrom =
window.frames[0].document.forms["frmMain"][i].value
        }
        break;
      case 'txtEffective2':
        if (window.frames[0].document.forms["frmMain"][i].value != '') {
          sEffectiveTo =
window.frames[0].document.forms["frmMain"][i].value
        }
        break;
      case 'txtPosted1':
        if (window.frames[0].document.forms["frmMain"][i].value != '') {
          sPostedFrom =
window.frames[0].document.forms["frmMain"][i].value
        }
        break;
      case 'txtPosted2':
        if (window.frames[0].document.forms["frmMain"][i].value != '') {
          sPostedTo =
window.frames[0].document.forms["frmMain"][i].value
        }
        break;
    }
    
    if (window.frames[0].document.forms["frmMain"][i].type == 'checkbox'
&& window.frames[0].document.forms["frmMain"][i].checked) {
      if
(window.frames[0].document.forms["frmMain"][i].name.indexOf("chk_") >=
0) {
        sYears += '"' +
window.frames[0].document.forms["frmMain"][i].name.substr(4) + '",';
      }
      if
(window.frames[0].document.forms["frmMain"][i].name.indexOf("cat_") >=
0) {
        sTypes += '"' +
window.frames[0].document.forms["frmMain"][i].name.substr(4) + '",';
      }
      if (window.frames[0].document.forms["frmMain"][i].name ==
'chkSelRegNone') {
        sNational = 'T';
      }
    }
  }
  
  console.info('Div:' + sDivisions);
  console.info('Reg:' + sRegions);
  console.info('e1::' + sEffectiveFrom);
  console.info('e2::' + sEffectiveTo);
  console.info('p1::' + sPostedFrom);
  console.info('p2::' + sPostedTo);
  console.info('year::' + sYears);
  console.info('cat::' + sTypes);
  console.info('nat:' + sNational);
  //console.info(window.frames[0].name);
  //alert('sRegions::' + sRegions);
  
  window.frames['frmMain'].location.href = "buildList.asp?Div=" +
sDivisions + "&Reg=" + sRegions;
}

Liam David Edwin Rice

liam.rice at autodata.net

This message has originated from Autodata Solutions.  The attached
material is the Confidential and Proprietary Information of Autodata
Solutions.  The email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to whom they
are addressed.  If you have received this email in error please delete
this message and notify the Autodata system administrator at
Administrator at autodata.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060613/57fe2f71/attachment.htm>


More information about the Javascript mailing list