Page 1 of 1

How to hide field radio button with jquery ProcessMaker 3.0

Posted: Thu May 21, 2015 9:44 pm
by khoer52
Hi everybody!

There is no documentation about how to acces radio button in the wiki, so i'm trying to give my solution here.
I hope it can help someone.
Code: Select all
    $("#radioName").change(function () {
      if ($('input[value=0]').prop("checked")){
          document.getElementById('fieldName').style.display = "none"; //hide if value 0 is checked
        } else {
          document.getElementById('fieldName').style.display = ""; //show if value 0 is unchecked
        }
        
    });

Re: How to hide field radio button with jquery ProcessMaker 3.0

Posted: Thu May 19, 2016 8:36 am
by JeniferLawrence
It is not working for me. kindly help to hide a value in radio button while loading form

Re: How to hide field radio button with jquery ProcessMaker 3.0

Posted: Thu May 19, 2016 10:37 pm
by amosbatto
You can use the following javascript code to hide a radio button (or any other type of control):
Code: Select all
$("#radioId").hide()
To show it:
Code: Select all
$("#radioId").show()
Change the code to the radio button's ID.

For example, create a checkbox with the ID "hideRadio" and create a radio button with the ID "radioList". Then the following JavaScript will hide the radio button when the checkbox is marked:
Code: Select all
$("#hideRadio").setOnchange( function(newVal, oldVal) {
   if ($("#clientType").css("display") == "none")
      $("#clientType").show();
   else
      $("#clientType").hide();
});   

Re: How to hide field radio button with jquery ProcessMaker 3.0

Posted: Fri May 20, 2016 6:21 am
by JeniferLawrence
I want to hide the values(options) in radio button field.
eg: Department has 5 options. I have to hide 4th and 5th option in first form, then i have to show 4th and 5th option in 2nd form.

Re: How to hide field radio button with jquery ProcessMaker 3.0

Posted: Fri May 20, 2016 8:57 pm
by amosbatto
To hide the 4th and 5th options:
Code: Select all
$($("#clientType").find("div.radio")[3]).hide();
$($("#clientType").find("div.radio")[4]).hide();
where "clientType" is the ID of the radio button.

Re: How to hide field radio button with jquery ProcessMaker 3.0

Posted: Sat May 21, 2016 1:20 am
by JeniferLawrence
Wow thank you #amosbatto. It is working. Thank you so much