braxwell Posted September 20, 2016 Report Share Posted September 20, 2016 How would I change this code to pull data from an existing data field and place that value in another field? script>function onSubmitClick() {var box1 = document.getElementById('box1');var box2 = document.getElementById('box2');box2.value = box1.value;}</script><textarea id='box1'></textarea><textarea id='box2'></textarea><button onclick='onSubmitClick(); return false'>Click Me</button> Quote Link to comment Share on other sites More sharing options...
MayMusic Posted September 22, 2016 Report Share Posted September 22, 2016 Do you want to change it to Caspio format? Is it on a submission page? In submission pages IDs are in this format: InsertRecordFIELDNAME So you need to have <script> function onSubmitClick() { var box1 = document.getElementById('InsertRecordFILEDONE'); var box2 = document.getElementById('InsertRecordFILEDTWO'); box2.value = box1.value; } </script> <button onclick='onSubmitClick(); return false'>Click Me</button> Replace InsertRecordFILEDONE and InsertRecordFILEDTWO with the actual ID. To get the ID you can also right click on the element and from the window that opens select inspect element Quote Link to comment Share on other sites More sharing options...
braxwell Posted September 23, 2016 Author Report Share Posted September 23, 2016 Its a field in a reports data page. I'm not having any luck getting this to work. Quote Link to comment Share on other sites More sharing options...
braxwell Posted September 23, 2016 Author Report Share Posted September 23, 2016 OK success - i had to change InsertRecord to EditRecord and that did the trick. Thanks !!!!!! 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.