Using html/jquery in the description field enables hiding of text fields, and checkbox elements.The lines below enable me to hide/show checkbox values.
<script type="text/javascript">
if( AJS.$("#customfield_10280-1").attr('checked') && AJS.$("#customfield_10280-2").attr('checked'))
{ AJS.$("#customfield_10281-1").closest('div.checkbox').show();
}
else
{ AJS.$("#customfield_10281-1").closest('div.checkbox').hide();
}
AJS.$("#customfield_10280-1").click(function(){
if( AJS.$("#customfield_10280-1").attr('checked') && AJS.$("#customfield_10280-2").attr('checked'))
{ AJS.$("#customfield_10281-1").closest('div.checkbox').show();
}
else
{ AJS.$("#customfield_10281-1").closest('div.checkbox').hide();
}
});
AJS.$("#customfield_10280-2").click(function(){
if( AJS.$("#customfield_10280-1").attr('checked') && AJS.$("#customfield_10280-2").attr('checked'))
{ AJS.$("#customfield_10281-1").closest('div.checkbox').show();
}
else
{ AJS.$("#customfield_10281-1").closest('div.checkbox').hide();
}
});
</script>
However, I can't seem to hide the checkbox field name. Does anybody know the trick for this? Inspecting the element reveals:
<fieldset class="group">
<legend>
<span>CAB Approval</span>
</legend>
<div class="checkbox" style="display: none;">
<input id="customfield_10281-1" class="checkbox" type="checkbox" value="yes" name="customfield_10281">
<label for="customfield_10281-1">yes</label>
</div>
<div class="description">
</fieldset>
Community moderators have prevented the ability to post new answers.
Something like this should work:
AJS.$(":input[name='" + fieldname + "']").closest('fieldset.group').hide();
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you say"checkbox field name", do you mean the legend, or the label element?
A diagram/picture may also help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.