Rich-text Reply

Editing default setting of drop down

FranJ 11-10-15

Editing default setting of drop down

In this site http://www.yadeliezer.org/ if you click on the red donate now button at the top right and then click on one of the radio buttons you are given a default option to donate $18.  We want to test setting the default at $36.

 

In optimizely we replaced this code:

 

<select name="amount" id="one_time_amount_gen" onchange="showOtherAmount(this)"><option value="18">$ 18</option><option value=" 36">$  36</option><option value=" 54">$  54</option><option value=" 100">$  100</option><option value=" 180">$  180</option><option value=" 360">$  360</option><option value=" 540">$  540</option><option value=" 1000">$  1000</option><option value=" 5000">$  5000</option><option value="other">Other $:</option></select>

 

With this code:

 

<select name="amount" id="one_time_amount_gen" onchange="showOtherAmount(this)"><option value="36">$ 36</option><option value=" 18">$  18</option><option value=" 54">$  54</option><option value=" 100">$  100</option><option value=" 180">$  180</option><option value=" 360">$  360</option><option value=" 540">$  540</option><option value=" 1000">$  1000</option><option value=" 5000">$  5000</option><option value="other">Other $:</option></select>

 

In editing mode this seems to work fine.  In preview mode however, the amount field does not appear when you click on one of the radio buttons.

 

Any possible solutions out there?

 

Thanks,

Fran

 

 

Level 2

JDahlinANF 11-10-15
 

Re: Editing default setting of drop down

@FranJ

 

I do not see the Optimizely loaded on the page you linked so I cannot look at what might be going wrong. 

 

Also... I humbly suggest that rather than re-ordering the options in the drop down, you instead actually set the one that you want selected.  That way the amounts are still listed in ascending order.

 

jQuery('select#one_time_amount_gen option[value=" 100"]').attr('selected',true);