Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By manalidhuri
#826563
Capture.PNG
Capture.PNG (2.32 KiB) Viewed 339 times
I have use this javascript code to add mandatory sign to the checkbox
Code: Select all
if(foreigncurrency=='14')
   {     
   	var h = '<span id="star" style="color:red">*</span>';
    $("#gglchek").find("label").append(h);
   }
  
   else
   {
      var h = '<span id="star" style="color:white">*</span>';
      $("#gglchek").find("#star").remove();
   }
but it will add two * signs as shown in screenshot and i have to remove one * which are mention using arrow.
Is there any way to resolve this issue?
Please help!

Thanks
#826576
To remove the other red asterisk in the field's label, you can use control.disableValidation() and
control.enableValidation().

If you don't want to change the required property and just want to remove the red asterisk, then you can hide it like this:
$("#fieldID").find("span.pmdynaform-field-required").hide()
and show it:
$("#fieldID").find("span.pmdynaform-field-required").show()
#826640
If you just want to add/remove a red asterisk in the field's label, then do it this way:
Code: Select all
if (foreigncurrency=='14')
   {     
     var h = '<span id="star" style="color:red">*</span>';
     $("#gglchek").find("span.textlabel").append(h);
   }
   else
   {
      var h = '<span id="star" style="color:white">*</span>';
      $("#gglchek").find("#star").remove();
   }
}
Build Cache issue

Hi. I am having an issue that is replicated in a […]

mandatory input document

I want to display alert message using javascript, […]

Change template of reset password

Anyone can help me, Please!

There is no way currently to migrate from version […]