Newbie question:

I need to write a cookie based on the value of a radio button form entry.

I'm using Breeze forms to create the radio button form. It allows for custom "action scripts" to be executed on submit events.

I have the javascript to set the cookie. I have the action script that returns the radio button input. Questions is how do I merge them together to write the cookie according to the radio entry.

Here's the action script:
(Gets the value of the currently checked radiobutton.)

function ff_checkedValue(name)
    // loop through elements and find checked
    for (i = 0; i < ff_elements.length; i++)
        if (ff_elements[i][2]==name) {
            e = ff_getElementByIndex(i);
            if (e.checked) return e.value;
        } // if 
    return '';
} // ff_checkedValue

Here's the cookie writing script:

script type = "text/javascript">
var expires = new Date();
expires.setDate(expires.getDate() + 365); // 365 = days to expire
document.cookie = "radio_1=[WHAT TO PUT HERE??];expires="+ expires.toGMTString()+"; path=/; domain=localhost";
What's the code that would write the cookie "radio_1" to the value that the action script returns?

Any help would be much appreciated here.