PDA

View Full Version : [CLOSED] Not able to change field label separator dynamically



MTSI
Oct 14, 2013, 4:49 PM
Hi,

I am setting required fields dynamically. so that i want to indicate red * symbol along with the filed label. I use label separator for that.


var setAllowBlankField = function (obj, condition) {
if (obj != undefined && obj != null) {
obj.allowBlank = condition;
obj.labelSeparator = obj.allowBlank ? "" : "<span class='red'>*</span>";
}
}

I debug the script, the value updated the separator. But I was not able to see the change in the screen. Is there any function to update the view like "reset"?

Thanks in advance.

geoffrey.mcgill
Oct 14, 2013, 6:16 PM
Give the following a try.


var setAllowBlankField = function (obj, condition) {
if (obj != undefined && obj != null) {
obj.allowBlank = condition;
obj.labelSeparator = obj.allowBlank ? "" : "<span class='red'>*</span>";
obj.setFieldLabel(obj.getFieldLabel());
}
}

That should reset the FieldLabel and use the new LabelSeparator.

Hope this helps.

MTSI
Oct 15, 2013, 5:18 AM
Give the following a try.


var setAllowBlankField = function (obj, condition) {
if (obj != undefined && obj != null) {
obj.allowBlank = condition;
obj.labelSeparator = obj.allowBlank ? "" : "<span class='red'>*</span>";
obj.setFieldLabel(obj.getFieldLabel());
}
}

That should reset the FieldLabel and use the new LabelSeparator.

Hope this helps.

It works. Thanks