How to split text from select dropdown to use for multiplication using Jquery/Javascript
<p>I have a select dropdown to choose a product size which also tells you the price for each sizing.</p>

<p>I want to display the total cost as well has how many hectares it will cover. 1kg = 1hectare</p>

<p>The value is the ID for the sizes and is used when adding to the cart.</p>

<pre><code>&lt;select class="productChoice"&gt;
    &lt;option value=""&gt;-- Please select --&lt;/option&gt;
    &lt;option value="2317474"&gt;1KG $180&lt;/option&gt;
    &lt;option value="2317475"&gt;5KG $100&lt;/option&gt;
    &lt;option value="2317476"&gt;10KG $200&lt;/option&gt;
    &lt;option value="2317477"&gt;50KG $900&lt;/option&gt;
&lt;/select&gt;

&lt;input type="text" id="Units_5183442" class="productTextInput" value="0"&gt;

&lt;label id="hectares_5183442"&gt;&lt;/label&gt; Hectares
&lt;label id="total_5183442"&gt;&lt;/label&gt;
</code></pre>

<p>So you choose your product size, then how many of that size you want to purchase. From there I want to display the two different values in the respective labels.</p>

<p>I'm struggling separating the option text to do what I need. Can't get past the NaN.</p>

<p>What I've got so far is:</p>

<pre><code>$('#Units_5183442').keyup(multiply);
$('select.productChoice').change(multiply);
function multiply() {
    var quantity = parseFloat($('#Units_5183442').val());
    var dollars = cantfigureouthowtodothis
    var size = cantfigureouthowtodothis

    $('#total_5183442').text('$'+(quantity * dollars )); 
    $('#hectares_5183442').text((quantity * size)); 
}
</code></pre>
