Found a great snippet on here , so fiddled with it and it does pretty much exactly what I want it to do. But .. obviously we dont want to run “strings” in value box, as we are attaching this form element to database.
So here is the script:
http://jsfiddle.net/ozzy/gwKfP/10/
Here is the code ( html )
<select id="duration">
<option value="0">Select</option>
<option value="$7.99">7 days</option>
<option value="$3.99">3 days</option>
</select>
I would prefer to have this all triggered off something other than value.. not sure if thats dooable.
Also in our form we have a checkbox immediately before this select box. I really would like it so unchecked , disables the select until the checkbox is ticked. Also if checkbox is unticked is there a way of changing value of select to zero ( 0 )
We use jquery ( but as you may guess I dont get js ) lol
My actual code is :
<label class="s_radio"><input class="inline" type="checkbox" value="ctv"/> yes</label>
<label class="s_radio">
<select id="duration" class="inline" style="width: 100px;">
<option value="0">Select</option>
<option value="$7.99">7 days</option>
<option value="$3.99">3 days</option>
</select> <span id="value" class="disabled" data-default="Please Choose"> Please Choose</span></label>
Add this to your document.ready function: