ManonG Posted October 24, 2019 Report Share Posted October 24, 2019 HI. How can I copy the text from a dropdown field to a text field when user select a dropdown value? Thank you Manon Quote Link to comment Share on other sites More sharing options...
0 Vitalikssssss Posted October 25, 2019 Report Share Posted October 25, 2019 Hi @ManonG, You can use the following script in Datapage Footer: <script type="text/javascript"> document.addEventListener('DataPageReady', function (event) { document.querySelector('[id*=InsertRecord*YOUR_DROPDOWN_FIELD*]').addEventListener('change', function() { let item = document.querySelector("select[id='InsertRecord*YOUR_DROPDOWN_FIELD*']").value; document.querySelector("input[id='InsertRecord*YOUR_TEXT_FIELD*']").value = item; }); }); </script> Please note that this JS code designed for Submission Form Datapage. Also, make sure you disable HTML editor and change *YOUR_DROPDOWN_FIELD* & *YOUR_TEXT_FIELD* to your actual field names. Hope this helps. Regards, vitalikssssss Quote Link to comment Share on other sites More sharing options...
0 ManonG Posted October 29, 2019 Author Report Share Posted October 29, 2019 Hi Vitalikssssss. Thank you for answering my question quickly. However as I don't know Javascript could you make me a simpler example with only 2 fields either : InsertRecordIdIdee_4231fb6d798953 (Dropdown) InsertRecordTitre (Text) Thank you. Thank you. Manon Quote Link to comment Share on other sites More sharing options...
0 kpcollier Posted October 29, 2019 Report Share Posted October 29, 2019 <script type="text/javascript"> document.addEventListener('DataPageReady', function (event) { document.querySelector('[id*=InsertRecordIdIdee]').addEventListener('change', function() { let item = document.querySelector("select[id='InsertRecordIdIdee']").value; document.querySelector("input[id='InsertRecordTitre']").value = item; }); }); </script> @ManonG, using @Vitalikssssss example with your field IDs, I believe this is the script you are looking for. Quote Link to comment Share on other sites More sharing options...
Question
ManonG
HI.
How can I copy the text from a dropdown field to a text field when user select a dropdown value?
Thank you
Manon
Link to comment
Share on other sites
3 answers to this question
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.