I have these radio-buttons in my checkout page:
<input id="95292" type="radio" name="GLSShop" value="95292" onclick="SaveShopID('95292')">
<input id="95064" type="radio" name="GLSShop" value="95064" onclick="SaveShopID('95064')">
<input id="95403" type="radio" name="GLSShop" value="95403" onclick="SaveShopID('95403')">
When user click e.g. button no. 2 I want the value of a textfield to be set to '95064'
I was thinking about making a java- or jqueryscript something like this:
function SaveShopID($ShopID){
$("#order_comments").val($ShopID);
};
1: Would this be the best and easiest way of doing it?
2: If so, how would the script look like, I would be surprised if mine is correct ;-)
3: where do I place the script?
4: How do I add/enqueue the script? I've seen examples using add_action("wp_enqueue_scripts'.....) but I'm not sure how to do it.
I use a child-scheme of course.
And I have full control of the radio button's HTML so it can be easily changed to something else if prefered ;-)