how i can hide field on javascript ?

Confluence User - 31 Jan, 2024

i have some select box and i want hide some value use javascript but somehow i can;t hide the label . reminder didn;t use hide section 

or there some FomUtil fuction to hide 1 id select box ?

forms;selectbox;javascript

2


01 Feb, 2024
confluenceUser
1
confluenceUser

Hi, once you obtain a reference to the element using FormUtil.getField, you can just use the hide() function (https://api.jquery.com/hide/).

01 Feb, 2024
confluenceUser
confluenceUser

yeah is work better and more easy but why the label didn;t get hide ? 


<script type="text/javascript">
 $(document).change(function(){
  
     console.log("test");
     
     var active1 = FormUtil.getValue("active");
     var a = FormUtil.getField("a");
     var b = FormUtil.getField("b");
     var c = FormUtil.getField("c");
     var d = FormUtil.getField("d");
     if(active1 == 0){
         a.hide();
         b.hide();
         c.hide();
         d.hide();
     }else{
        a.show();
        b.show();
        c.show();
        d.show();
     }
 });

</script>


RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print