Hello,

The following code takes a text field value, in a form, and creates a cookie. Works fine. However, I tried with a radio button value and no cookie was created How do I use the following code to create a cookie for non text fields?

Thanks

Code:
    <script language="JavaScript" type="text/javascript">
    
    function validate_form() {
    var email = document.myform.email.value.split(' ')[0];
    var expire_in_days = 14;
    var expire_date = new Date(); 
    expire_date.setTime(expire_date.getTime() + (expire_in_days$24$60$60$1000));
    setCookie('email',email,expire_date);
    return true;
    }
    
    
    function setCookie(name, value, expires, path, domain, secure) {
    document.cookie= name + "=" + escape(value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
    }
    </script>
Ps. Form name is myform and the first function is called through the form anchor tag after the form action url.