Niether method worked :-(
Using your method I need append an already existing onChange trigger:
(note the form is called "ecart_checkout_form"
<select name="shipSelect" id="shipSelect" onchange="document.getElementById('checkoutForm').submit(); document.ecart_checkout_form.shipping_method.value = document.ecart_checkout_form. shipSelect[document.ecart_checkout_form. shipSelect.selectedIndex].text">
The hidden field is named "shipping_method":
<input type="hidden" name="shipping_method" id="shipping_method" value="<?php echo ((isset($_SESSION["eCartCheckoutForm_shipping_method"]))?$_SESSION["eCartCheckoutForm_shipping_method"]:"") ?>" />
and setting the session is as follows referencing the hidden field name:
if (!session_id()) session_start();
if($_SERVER["REQUEST_METHOD"] == "POST") {
$_SESSION["eCartCheckoutForm_shipping_method"] = "".((isset($_POST["shipping_method"]))?$_POST["shipping_method"]:"") ."";
}
I use a print_r ($_SESSION); on the confirm page and only see the hidden value still supporting the numeric cost of the selected shipping.
I'll keep studying this but can not currently see the problem other than the JS that should be getting the label value?