Populate data from parent to grid form

Confluence User - 03 Apr, 2016

Hi Experts,

I need to populate data from one field in parent Form to second field in Grid Form form as shown below.

Using hash variable #form.tableName.fieldId# is not an option as parent Form data is not saved yet, so I'm not getting value before "save".

Do you have any idea how to fix this issue? I was also trying to use below CustomHTML code but without success.

 

<script>
$(document).ready(function(){
var diff = FormUtil.getField("ParentFormFieldID"); });
$('input[name=GridFormFieldID]').val(diff);
</script>

 

 

forms

4


03 Apr, 2016
confluenceUser
confluenceUser

Hi Sylwester Nowak,

Maybe you can try this Javascript in the form grid's form:

 
<script>
$(document).ready(function(){
....
var ParentValue = $('[name$=ParentFieldId]', window.parent.document).val();
....
</script>
30 May, 2016
confluenceUser
confluenceUser

same issue with me

30 May, 2016
confluenceUser
confluenceUser

Hi Satria,

use below code, it works for me (you need to add Custom HTML in grid form and change naming for fields.

BR,

Sylwester

 

<script type="text/javascript">
//script which is populating data from parent table
    $(document).ready(function(){
        var mainFormField = "parent_field";
        var fieldId = "grid_field";
 
        //get value from parent form
        var value = $('[name='+mainFormField+']:enabled', window.parent.document).val();
 
        //store the value to a field
        $('[name='+fieldId+']:enabled').val(value);
    });
</script>
24 Jun, 2018
confluenceUser
confluenceUser

Like it (smile) ... 

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print