Hi all,
So I have a dropdown product field with various options and labels (think that's the terminology) So the option is 'Top Fuel Dragster', the price is '50' and the label is 'TF'
Using the below code, I have managed to display 'Top Fuel Dragster' in a separate text box.
<script type="text/javascript"> jQuery(document).ready(function($){ $(document).on('change', 'select[name="item_meta[125]"]', function(){ var val1 = $("select[name='item_meta[125]']").children("option").filter(":selected").text().trim(); $("#field_FIELDKEY").val(val1); $("#field_FIELDKEY").change(); }); }); </script>
Does any one know if there is a piece of code that will display the label 'TF' instead in another text box? I can't work out how to do it.
Alternatively (and my preferred option) is there an 'if then that' piece of code that will display a value if a text box contains the right thing?
So if textbox 1 contains 'Top Fuel Dragster' > display 'TF' in textbox 2
Thanks in advance
Thanks Bobby, but that just shows the price in the field, rather than the text.
What does just the ID show versus "show value"?
Just the ID also shows the price, which doesn't seem right to me!
Right? Seems odd. This is a woocommerce product?
No, just added within the form. Not linked to Woocommerce or anything. Just the simple 'Product field' as a dropdown
Please login or Register to submit your answer