Master Posted July 27, 2017 Report Share Posted July 27, 2017 Would you be able to help me figure out what I'm doing incorrectly. I have a cascading drop down in a submission form that has multiselect enabled (Services). What I want it to do, is that the values of the selected service, be copied to the Description Field as values separated by a comma. Here is the scripts I'm using. It just generates a value of "undefined," so I know something is wrong, but I can't figure out what. Any help is greatly appreciated. var x=document.getElementsByName("InsertRecordServices"); x[0].multiple=true; document.getElementsByName("InsertRecordServices")[0].onblur = function () { document.getElementById("InsertRecordDescription").value = document.getElementsByName("InsertRecordServices").value; } Quote Link to comment Share on other sites More sharing options...
MayMusic Posted July 27, 2017 Report Share Posted July 27, 2017 Add the code below to the header of the page: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script> window.onload = function multiselect() { var a = document.getElementsByTagName('select'); var index; for (index = 0; index < a.length; ++index) { if (a[index].size!==0) { a[index].multiple=true; } } } </script> And this code to the Footer <script> $('[name=InsertRecordServices]').change(function() { $('[name=InsertRecordDescription]').val($('[name=InsertRecordServices]').val()) }); </script> 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.