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:

function onSubmitClick() {
</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

function onSubmitClick() {
document.getElementById("InserRecordSUB_OD_CYL").value = document.getElementById("InserRecordSUB_OD_SPH").value;

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.

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.

  • Create New...