It's passing two attributes, I fixed the problem anyway.




------------------------------------------------------------------------
-
FIGHT BACK AGAINST SPAM!
Download Spam Inspector, the Award Winning Anti-Spam Filter
http://mail.giantcompany.com



-----Original Message-----
From: Stephen Fernandez [mailto:[EMAIL PROTECTED] 
Sent: 16 September 2003 21:31
To: [EMAIL PROTECTED]
Subject: Re: [ cf-dev ] A bit of JS


what is the purpose of the comma between this bit of code?
if(isPermissionEnabled(permissionsArray[i][0]
and this bit of code
document.forms[0].group.value))
?

----- Original Message ----- 
From: "Snake Hollywood" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 16, 2003 8:57 PM
Subject: [ cf-dev ] A bit of JS


Can anyone see why this bit of JS would get stuck in a loop ? It is this
line that causes it. if(isPermissionEnabled(permissionsArray[i][0],
document.forms[0].group.value))

And my select list seems to get stuck in a loop like it adding endless
options, but I cannot see how it can be.



function isPermissionEnabled(permissionID,groupID)
{
var returnval = false;
if(permissionsLookupArray.length > 0)
for(i=0;i<permissionsLookupArray.length;i++)
{
if(permissionsLookupArray[i][0] == groupID &&
permissionsLookupArray[i][1] == groupID) returnval = true; } return
returnval; }

function popPermissions(resourceID)
//populate permissions list with permissions for selected resource {
document.forms[0].permissions.options.length = 0;

for(i=0;i<permissionsArray.length;i++)
{
if( permissionsArray[i][3] == resourceID)
{
newOpt = new Option();
newOpt.text = permissionsArray[i][1];
newOpt.value = permissionsArray[i][0];
//check if each permission is already enabled
for the selected group, and make it selected if so
if(isPermissionEnabled(permissionsArray[i][0],
document.forms[0].group.value))
newOpt.selected = true;

document.forms[0].permissions.options[document.forms[0].permissions.opti
ons.length] = newOpt;


}
}
}


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] For
human help, e-mail: [EMAIL PROTECTED]




---
Outgoing mail is certified Drug, Virus and Religion Free. Checked by AVG
anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 01/09/2003

-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] For
human help, e-mail: [EMAIL PROTECTED]


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to