Jump to content
  • 0

How do I hide a submit button based on a dropdown value?


Question

How do I hide the submit button when the data in a dropdown is blank and show when it chooses one of the two values? Currently I have a dropdown that says "Ready to place an order?" and when clicked, you have two options: "Order Now" or "Call for Payment." I want the submit button hidden until they make one or the other choices. Thank you in advance!

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0
On 11/2/2017 at 7:13 PM, 74Systems said:

How do I hide the submit button when the data in a dropdown is blank and show when it chooses one of the two values? Currently I have a dropdown that says "Ready to place an order?" and when clicked, you have two options: "Order Now" or "Call for Payment." I want the submit button hidden until they make one or the other choices. Thank you in advance!

You may insert my script in the footer of the submission form

<script>

function hide() {

var v_value = document.getElementsByName("InsertRecordFieldName")[0].value;

if (v_value.length<1){
document.getElementById("Submit").style.display="none";
}
else{
document.getElementById("Submit").style.display = "inline-block";
}
}
window.onload = hide;
 document.getElementsByName("InsertRecordFieldName")[0].onblur=hide;

</script> 

Use your field name instead of: FieldName

Link to post
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
Answer this question...

×   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...