Copy checkbox and radio button value to hidden field

I have a form that has text fields, text areas, checkboxes and a radio button. I need to copy the content of the form to hidden fields in another form. I’ve managed to copy the text fields and text areas to hidden fields but I can’t copy the value of the checkboxes or radio button.

I have four separate checkboxes and each one is unique and will copy to a unique hidden field. Each checkbox will have a value of Y if checked and I’d like the hidden field to have a value of N if the checkbox is not checked and Y if it is checked.

The same rule applies for the radio button, it can either be Y (checked) or N (not checked).

As mentioned above, I’ve already got a JavaScript function (on an onclick event) that copies the text fields and text areas so I just want to add the copy checkbox value code into my existing function.

Hope someone can help.