Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
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 4669 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();
   }
}
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]