[ad_1]
Good afternoon. I would like to know if you can help me with a question? I have a switch function, whose initial value, when the page is loaded, is assigned by another switch function. It happens that when loading the page, the first function mentioned does not run completely.
The value contained in fieldname1 is correct, as it gives the desired values. fieldname2 is a radioButtons field. Both functions below are in a Calculated Field. Is it possible for them to help?
Here’s the example:
var url = fieldname1;
switch(url) {
case 1:
getField(2).setVal('1');
break;
case 2:
getField(2).setVal('2');
break;
case 3:
getField(2).setVal('3');
break;
default:
return ('1');
break;
}})();
(function masterSwitch(){
var css = {};
switch(fieldname2) {
case 1:
css['border'] = ' solid transparent';
css['borderImage'] = 'url(image1.png) 30';
break;
case 2:
css['border'] = ' solid transparent';
css['borderImage'] = 'url(image2.png) 30';
break;
case 3:
css['border'] = ' solid transparent';
css['borderImage'] = 'url(image3.png) 30';
break;
default:
css['border'] = ' solid transparent';
css['borderImage'] = 'url(image1.png) 30';
break;
}
jQuery('#image').each(function(){jQuery(this).css(css);});})();
