How to overwrite the list grid cell value in parent form?

Confluence User - 28 Nov, 2017

Hi there,

Is there any sample to overwrite the parent list grid cell value once the value in child form is changed? My scenario as below, reset the completion date to blank in parent form if the completion status in child form had changed to "No".  Would appreciate for any advise.  Many thanks ahead.

 

Child form


Parent form


 

Regards,

Wah Man

forms;datalists

2


28 Nov, 2017
confluenceUser
confluenceUser

Hi

You can try this Javascript to init/blank the completion date value if status === a certain value on submit click (amend the field id names accordingly to yr form, add this script in yr child form customHTML element):

 

<!-- Add in form customHTML -->
<script>
$(document).ready( function() {
    $('#submit').click(function() {
		var myStatus=FormUtil.getValue("status");
		if (myStatus === 'completed') {
			$('[name=completionDate]').val("");
		}
 });
});
</script>

 

You might need to remove the field validator (mandatory field) on 'Completion Date' for this to work, else you will not be able to save the form into the form grid with a blank 'Completion Date'. Instead use JS to check if status === ongoing, 'Completion Date' is mandatory.

 

28 Nov, 2017
confluenceUser
confluenceUser

First of all, thanks for your answer. In fact, my problem is I am not able to reset to blank value in parent form - list grid cell value. Would appreciate for your further advise. Thanks.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print