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
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4