Jump to content
  • 0

store the input in the same field as the radio button d


askche

Question

Hi,

I want to create a field that allows user to select from the radio button options (such as "red", "green" and "other") and if "other" is selected, then requires user to specify what "other" is in a text field next to it. I want the data that will be entered in the text field also stored in the same field as "red" or "green" is.

Is there a way to do so?

Thank you.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Try this in the submission page footer:

function assign(){

var other= document.getElemetById('cbParamVirtual1').value;

if (document.getElemetsByName('InsertRecordRADIO BUTTON FIELD ID').value == "other"){

document.getElemetById('cbParamVirtual1').value= other;

}

}

document.getElementById('caspioform').onsubmit = assign;

You need to replace InsertRecordRADIO BUTTON FIELD ID with your radio button field ID and cbParamVirtual1 with the virtual field ID.

Link to comment
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
Answer this question...

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