I read Javascript selecting form elements using name attribute and from that have gotten the following form select working:
field_I_am_after: $(':input[name="panes[delivery][address][delivery_zone]"]').val(),
BUT it delivers the "selected" class NUMBER - in this case "12" from a group of State id's in an Ubercart form as follows:
<select id="edit-panes-delivery-address-delivery-zone" name="panes[delivery][address][delivery_zone]" class="form-select required">
. . . MORE . . .
<option value="11">Armed Forces Pacific</option>
<option value="12" selected="selected">California</option>
<option value="13">Colorado</option>
. . . MORE . . .
</select>
I am trying to get the NAME for "selected" to go into / be the "field_I_am_after", that is i.e. => $(' . . . option:selected').val()
, or .text()
,
I also reviewed Get selected text from a drop-down list (select box) using jQuery and tried most of what was suggested. I am using JQuery 1.8 due to issues with ckeditor complaining about newer versions and not working with them
All the variants I tried to append this to my working statement have not worked
Can anyone see what have I done wrong - or incomplete ??