[CLOSED] Not able to change field label separator dynamically

  1. #1

    [CLOSED] Not able to change field label separator dynamically

    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.
    Last edited by geoffrey.mcgill; Oct 15, 2013 at 4:33 AM. Reason: [CLOSED]
  2. #2
    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.
    Geoffrey McGill
    Founder
  3. #3
    Quote Originally Posted by geoffrey.mcgill View Post
    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

Similar Threads

  1. [CLOSED] Label Separator - change Default
    By xtoolz in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Aug 20, 2015, 6:26 PM
  2. [CLOSED] Group separator property for number field
    By Daly_AF in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 11, 2012, 4:26 PM
  3. [CLOSED] Thousand separator in number Field
    By FpNetWorth in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 28, 2010, 1:01 PM
  4. [CLOSED] How to avoid using Thousand Separator in Coolite Number Field
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 02, 2010, 8:29 AM
  5. [CLOSED] Dynamically set field label in javascript
    By macap in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 29, 2009, 4:17 AM

Tags for this Thread

Posting Permissions