braxwell Posted September 20, 2016 Report Share Posted September 20, 2016 Please Help!!!! I need to insert a button into a form that when clicked will copy data from one field to another field in the same form. Here is what I have: <script> function onSubmitClick() { "SUB_OD_CYL" = "SUB_OD_SPH" } </script><button onclick="onSubmitClick(); return false">Click Me</button> The field names are : SUB_OD_SPH I want to copy the value entered into this field and place the same value in the field - SUB_OD_CYL I'm sure I'm missing things in the script but I cannot find any clear direction - please help!!! Quote Link to comment Share on other sites More sharing options...
MayMusic Posted September 20, 2016 Report Share Posted September 20, 2016 What is the DataPage type? You should place this code below all other elements <script> function onSubmitClick() { document.getElementById("InserRecordSUB_OD_CYL").value = document.getElementById("InserRecordSUB_OD_SPH").value; } </script> If it is an update page change InsertRecord to EditRecord. Script can be place in Footer and HTML block where you have button code anywhere on your page Quote Link to comment Share on other sites More sharing options...
MayMusic Posted January 18, 2018 Report Share Posted January 18, 2018 The fields in the code on update or details page needs to be in an editable form element not display only If you are using them as cascading element or parent to cascading you need to change document.getElementById('XXX') to document.getElementsByName('XXX')[0] 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.