Bug 396974 - Custom fields: Ability to say "during this status, this field must have a value"
rojanu
aliustek at gmail.com
Tue Nov 18 14:39:51 UTC 2008
Hi everyone!
I am trying to apply
https://bugzilla.mozilla.org/show_bug.cgi?id=396974
to bugzilla 3.2-rc2. I have applied it and trying to get it to work.
In "Show Condition" I have tried
if(document.getElementsByName('product').value== 'my_product'){
return false;
}
which doesn't work, because at the time the script runs "product"
element is not available, then I have found "getURLParam" function
from google
function getURLParam(strParamName){
var strReturn = "";
var strHref = window.location.href;
if ( strHref.indexOf("?") > -1 ){
var strQueryString = strHref.substr(strHref.indexOf
("?")).toLowerCase();
var aQueryString = strQueryString.split("&");
for ( var iParam = 0; iParam < aQueryString.length; iParam++ )
{
if (
aQueryString[iParam].indexOf(strParamName.toLowerCase
() + "=") > -1 ){
var aParam = aQueryString[iParam].split("=");
strReturn = aParam[1];
break;
}
}
}
return unescape(strReturn);
}
and used following;
if(getURLParam('product') == 'my_product'){
return false;
}
which woks. I don't know how am I supposed to code in "Advanced
Custom fields" fields, Is above OK?
Is it possible to get an example for each.
Thanks
_______________________________________________
dev-apps-bugzilla mailing list
dev-apps-bugzilla at lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-apps-bugzilla
More information about the developers
mailing list