Great minds - I was thinking the same thing about hiding the child form as well and worked that on the next version of the code.
So few things, that are kind of explained in the code - I've got it to hide the Child Form when going back, and to show the 'Next' button in that case without the click of the Child Form submit.
1. Need to add a Input Field on the normal blank Parent form for the 'Connection' to the child object. Don't worry, I'm hiding it in the code. This way the data is loaded and the code can check if the Parent already has a Child and progress properly.
2. Suggest adding a Rich Text View that will display if the user already has a Child Form submitted - in the code it will hide if the child is not present and show if it is (in place of the Child Form)
/*Change the Following pieces to fit your application:
view_2: Child Form
view_3: form with only the 'Connection' field
view_4: Rich Text view for message that will display if a Child form already exists
kn-input-field_4: Change the 'field_4' portion to be the field of the Connection to the Child object located within the Parent Object
data.field_4: Again change the field_4 portion to match
*/
$(document).on(‘knack-record-create.view_2’, function () {
show_next_btn()
});
(document).on('knack-view-render.view_3', function (event, view, data) {
(’#view_3 #kn-input-field_4’).hide();
$(’#view_4’).hide();
if (data.field_4 == “”) {
$("#view_3 .kn-submit input[type=submit]").hide();
}
else {
('#view_2').hide();
(’#view_4’).show();
}
})
function show_next_btn () {
$("#view_3 .kn-submit input[type=submit]").show()
}
Let me know how this works for you.