Hello!
I have a couple forms that are solely used for custom tabs in the web client. In the Form URL, I am pulling metadata values from the document. My goal is that when a certain document is selected and the contract type is populated in the form field 138, the submit button will show and conversely be hidden when another contract type is selected. The code below works, but only when the drop down value is manually changed. The contract type field is hidden so the end user doesn't know it exists. As it stands now, for all values the Submit button is hidden when the page loads. If I unhide the contract type field and manually select a contract type, the Submit field is hidden or shown based on the value.
Any help would be appreciated!
Thanks.
$(document).ready(function() { //cache the elements we will use var $submit = $('.Submit'); var $Field138 = $('#Field138'); //hide the submit button $submit.hide(); //bind event handler to the dropdown field $Field138.change(function() { //if the user selects what we want, show the submit button if ($Field138.find(':selected').val() === "Master Services Agreement"){ $submit.show(); } else if ($Field138.find(':selected').val() === "Contracts (Other than MSA)"){ $submit.show(); } //if not, hide it else { $submit.hide(); } }); });