coxdabd — 2011-04-13T19:27:22-04:00 — #1
Now by default the first size is shown. If a user clicks on a different size, I want the price to change in the main product price div. How can this be done?
So basically want I want is: if there is an option that has brackets, then strip the brackets and show what's inside them in the main price DIV.
Any help is appreciated as always!
felgall — 2011-04-13T22:26:35-04:00 — #2
A regular expression would probably be the easiest way to do that.
centered_effect — 2011-04-13T23:07:59-04:00 — #3
If this will be in a select drop down, why not put the dollar amount in the value attribute?
<option value="£25.00">Small (£25.00)</option>
Here is a quick test using jQuery:
<option value="£25.00" selected="selected">Small (£25.00)</option>
<option value="£30.00">Medium (£30.00)</option>
<option value="£35.00">Large (£35.00)</option>
var value = $('select[name="selectItem"] option:selected').val();
coxdabd — 2011-04-14T02:56:31-04:00 — #4
Hey dude, I need the value of the option as when a user chooses the option, the value is then compared to that in the database and gets the price, hence why if I could get the figure between the brackets then update the price DIV.