Change select option and add a new row in child table when another child table is changed

I have 2 child tables in one doctype named Sales Invoice.

  1. When I choose the product from first child table, 2 rows will be added automatically because product is configured with Item tax template. Once 2 rows added, I want to change the select option from “On Net Total” to “Actual” on second row. And once Actual is selected, I want to set value. Of course value is dynamic value based on the product selected in first child table. I tried to add client script with event triggers, but doesn’t work. I am not sure how to detect / trigger events when rows are added in the second child table, etc…

  2. And once actions are done above, I want the button ADD ROW to be auto clicked. I am not able to enter the data unless the button is clicked. Some One help me.

Thank you so much!.