Get the value of a radio button

Get the value of a radio button

  
I have a rather odd setup that I'm having trouble resolving.  I have two tables that I am querying on the same page (since they are the same form on paper, but to ease issues on the systems, we are storing each page as a separate table).  So I find myself having to copy the value of a radio button (the values are "Trial 1" or "Trial 2") and copy them to a column in the second table.  Is there any way to retrieve the text value of the selected radio button and copy that value to the text field in the second table?

Thanks

Josh
Hi Joshua,

Can't you just do it with the On Change action of the radio buttons? I pretty sure it is more complex than this, if you can provide an .oml with the example I'll be glad to try and help you.

Cheers,
Hermínio Mira

I am confused what you are asking exactly.

I don't understand why you want to place the text-value of a radio-button in another entity.
Should it not be the identifier, since I assume that the radio-button represents a foreign-key in the entity(?)

 

I have attempted to set the value of a hidden text box to say either "Trial 1" or "Trial 2" using the onchange check of:

if(document.getElementById('" + radiobutton.id + "').selected == true)
{
document.getElementById('" + hiddentextbox.id + "').value =='Trial 1';
}

but the value of the text box is never getting set using this logic.  I'll admit I am probably using an incorrect command somewhere, but I can't seem to find which one is incorrect.

As for the foreign key, there is actually no foreign key connecting the two tables.  The reasoning behind this is that all of this data (for the most part) is coming in from faxed forms, and we might/might not ever get that second form through the faxes.  So, to minimize issues, I am simply hard setting the "keys" from the first table (subject, visit, date, trial number) into the secondary table so that they are always linked.  When the page was originally designed, it was all obe table instead of two.  It was seperated later on.

Thanks

Josh
Why are you even using javascript for this? I've attached a simple example. 

Hope it helps,
Hermínio Mira
I was finally able to determine the issue.  The reason why I was unable to set the value of the hidden text box so that I could use it for validation, is that OutSystems doesn't "hide" the textbox when the Visible property is set to false, it doesn't add it to the page at all.  This is why I was unable to set the value of the variable.  I created a display: none; css style and applied it to the hidden text boxes, and the system is now validating the information correctly.  Thanks for all the help.

Josh