Calling Web Screen JavaScript

Calling Web Screen JavaScript

  
I'm currently trying to call JavaScript I added to the JavaScript properties of one of my web screens.  I am then trying to call if from an onchange event on a radio button (it's a long story as to why).  Whenever I try to run it, I get an error saying that the function I wrote is not defined.  Here is the code from the web screen JavaScript block:

function Page_1_Radio_Check(item_id, page_1_check_id)
{
    alert('test1');
    if ($v(item_id))
    {
        alert('test2');
        if (!$v(page_1_check_id))
        {
            alert('test3');
            $x_Value(page_1_check_id, true);
        }
    }
}

function Page_2_Radio_Check(item_id)
{
    if (document.getElementById('item_id').checked == true)
    {
        if (document.getElementById('" + Page_2.Id + "').value == false
        {
            document.getElementById('" + Page_2.Id + "').value = true;
        }
    }
}

and here is the onchange event I am using to call it

"var item_id = " + OUT_CRF11_filled_out_by_dad.Id + ";
var page_1_id = " + Page_1.Id + ";
Page_1_Radio_Check(item_id, page_1_id);"

How am I defining/calling these two items incrrectly?  I checked the help section of OutSystems, and there are a couple pictures there that I believe I am following correctly, but they are almost impossible to read due to their size.  Any help would be greatly appreciated.  (If I can't get this working I have to completely rebuild my page and several others just like it and I would really like to not have to do that)

Thanks

Josh
Joshua,

Below is some sample code that works.  I think the issue might be in the switch from Javascript to Service Studio code:

WebScreen Javascript:

function UpdateButton (newVal, buttonId) {
    document.getElementById(buttonId).value = newVal;

}

In RunJavaScript2 Action:
"UpdateButton('" + " "+ Count_Comments.List.Current.Integer.Value + " " + "','" + ButtonId +"' );"

The single-quote/double quote combinations are hard to see in this font.
Are you using this single/double sequence correctly in the OnChange event code?
function UpdateButton(newVal, Id) {
    document.getElementById(Id).value = newVal;
}
function UpdateButton(newVal, Id) {
    document.getElementById(Id).value = newVal;
}
function UpdateButton(newVal, Id) {
    document.getElementById(Id).value = newVal;
}
function UpdateButton(newVal, Id) {
    document.getElementById(Id).value = newVal;
}
Scott,

Apparently I was missing the single quotes when I was trying to send the Id.  Thanks for the help.

Josh