Removing textfield completely in subform

Confluence User - 01 Oct, 2018

Hi,

I want to remove the whole field/attritbute of that particular part of my subform on this form without removing it original form as it can be used for other part, so why my subform become like this? Not just the textfield but including the label I want it to be removed.

here are my codes that i used on Custom HTML below subform

<script>
$(function(){
var field = FormUtil.getField("id_mobile_number");
$(field).attr("disabled", "disabled");
var field = FormUtil.getField("id_position");
$(field).remove();
var field = FormUtil.getField("id_explanation");
$(field).remove();
});
</script>

I've try using this method but doesn't work either

$(id_explanation).remove(); // or
var field = FormUtil.getField("id_explanation");
$(field).hide(); // or
$(id_explanation).hide();

forms;userviews;javascript

1


03 Oct, 2018
confluenceUser
confluenceUser

Hi, your code seems to be just hiding the input field. If you want to hide the label you should also do that. Alternatively, instead of manually hiding fields with code why not create separate forms with the appropriate fields.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print