Seems to work for me.

win2000/ie5.0.*

WG

-----Original Message-----
From: Taco Fleur [mailto:[EMAIL PROTECTED]]
Sent: 19 February 2003 10:16
To: CF-Talk
Subject: Javascript Error Reporting


I wrote this function to supress and report error messages within
JavaScript, all works fine except that when calling the function "msg =
fnFormElements();" it does not return anything, but when I call the function
"fnFormElements()" directly from a page it returns all elements.. What am I
missing? Anyone?


window.onerror = fnErrorReporting

function fnFormElements()
{
 var objF = document.forms
 var msg = "";
    for ( i=0; i < objF.length ;)
 {
  msg = msg + " Form: " + objF[i].name + "\n";
  var objE = objF[i].elements;
  for ( i2=0; i2 < objE.length ;)
  {
   msg = msg + " Element name: " + objE[i2].name + " Value: " +
objE[i2].value + "\n";
   i2++;
  }
   i++;
    }
 alert(msg);
 return msg;
}

function fnErrorReporting( message, url, line )
{
 msg = fnFormElements();
 alert("Message: " + message + "\nURL: " + url + "\nLine #: " + line +
"\nCookie: " + document.cookie
 + "\nBrowser: " + navigator.appName + " V" + navigator.appVersion +
"\nMIME: " + navigator.mimeTypes
 + "\nPlatform: " + navigator.platform + "\nUseragent: " +
navigator.userAgent + "\nForm Fields: " + msg);
}



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to