Jump to content
Vitalikssssss

Add a value from the Dropdown field to the Text field

Recommended Posts

Hi @Vitalikssssss,

You should add two text fields to the Selected fields on the Submission form and one of them make a Dropdown form element. After that create a Header and Footer element and past the following code into the footer after disabling HTML edotir:

 

<script>
document.addEventListener("DataPageReady", function() {

    let dropdown = document.getElementById('InsertRecordname');
    let textfield = document.getElementById('InsertRecordnumber');
    let change = function() {
        textfield.value = this.options[this.selectedIndex].value;
    };
    if (document.addEventListener !== undefined) {
        dropdown.addEventListener('change', change, true);
    } else if (document.attachEvent) {
        dropdown.attachEvent('onchange', change);
    } else {
        dropdown.onchange = change;
    }

});

</script>

InsertRecordname and InsertRecordnumber are the ids of the text fields elements  where InsertRecordname is set to the Dropdown form element.image.png.b2a10ee710e226f84a318d9f11894b2a.png

  

image.png

Share this post


Link to post
Share on other sites

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...