Jump to content

Disable Inline Add Submit Button Until Cascading Field Has Changed Value


Recommended Posts

If you have a Tabular Report with the Inline Insert enabled wherein one field is a dropdown and another field is a cascading field that is based on the dropdown and if you want to make sure that the value in the cascading field matches the selected value in the dropdown before your users get to submit, you can use the following script:

 

<script>

 var dropdown = document.querySelector("[id*='InlineAddDropdown_']");
var field = document.querySelector("[id*='InlineAddCascadingField_']");


field.addEventListener("change", myDropdownFunction);
field.addEventListener("change", myFieldFunction);

function myDropdownFunction() {
document.querySelector(".cbResultSetAddButton").disabled = true;
}

function myFieldFunction() {
document.querySelector(".cbResultSetAddButton").disabled = false;
}

</script>

Make sure to replace the "Dropdown" in document.querySelector("[id*='InlineAddDropdown_']"); with the name of your parent field. Likewise, replace "CascadingField" in 
var field = document.querySelector("[id*='InlineAddCascadingField_']") with the name of your cascading field.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...