Forums

Forums / Developing Portals / Prevent child form submission based on custom condition

Prevent child form submission based on custom condition

Thread is closed for posting
2 posts, 1 answered
  1. Missing user
    Missing user avatar
    29 Jan 2017
    Link to this post
    Hi, we have a parent and child form on the same page and they both submit successfully in one hit. We do show the child form fields upon setting a flag on the parent form. In another word, if the flag is set to "yes" then the child form fields are shown underneath, otherwise (when the flag is set to "no") the child form is hidden from end user. This is achieved via JavaScript and working like a charm.

    The problem is when the flag is set to "no" and although the child form fields are hidden, they still do submit and TPC is creating an empty child record in CRM. Thus, how can we stop the child form submission but yet keep the parent form submission because we still need to record whether the user selected "yes" or "no"? We don't want to create empty child records unnecessarily.

    Regards,
    Ethra
  2. Clinton Bale
    Clinton Bale avatar
    126 posts
    Registered:
    21 Feb 2014
    Answered
    31 Jan 2017 in reply to Missing user
    Link to this post
    Hello Ethra,

    To stop fields from submitting to Dynamics CRM you must disable them. So in addition to hiding the fields in JavaScript, disable them as well.

    Please let me know if this works.

    Regards,
    Clinton
2 posts, 1 answered