wgalliance Posted June 13, 2016 Report Share Posted June 13, 2016 I have a submission form with a drop down menu listing National or Local. I would like a way that if the user selects "National" in the dropdown menu, upon submission of the form the StateCampaign checkbox field is set to "yes". Thanks. Quote Link to comment Share on other sites More sharing options...
MayMusic Posted June 13, 2016 Report Share Posted June 13, 2016 You can have this code in the Footer of the page: <script> document.getElementById('Submit').onmouseover = function(){ if (document.getElementById("DROP DOWN FIELD ID").value == "National") { document.getElementById('CHECK BOX ID').checked = true;} else { document.getElementById('CHECK BOX ID').checked = false; } } </script> Replace "DROP DOWN FIELD ID" and "CHECK BOX ID" with appropriate IDs Quote Link to comment Share on other sites More sharing options...
wgalliance Posted June 15, 2016 Author Report Share Posted June 15, 2016 Thanks this code worked perfectly. I would like the Drop Down field to be a cascading dropdown, when this is done, the script no longer checks the box. I assume this is due to the cascading drop down. How would I edit the code in this scenario? Quote Link to comment Share on other sites More sharing options...
MayMusic Posted June 15, 2016 Report Share Posted June 15, 2016 Try to change document.getElementById("DROP DOWN FIELD ID").value To: document.getElementsByName("DROP DOWN FIELD ID")[0].value Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.