Jump to content

Button to Copy Data from One Field to Another


Recommended Posts

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!!!
 
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 1 year later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...