0

I am having a little problem trying to bind an action to an HTML select option. At the moment I have:

<select name ="delivery ">
    <p><option value="1"</p>Free Delivery</option>                            
    <p><option value="2"</p>Next-day</option>                        
</select>

If option one is pressed, then I would like ${cart.subtotal} to remain the same value but if option 2 is pressed then ${cart.subtotal + 3.50}

1
  • 1
    First your html code is illegal,and then I don't know what's the ${cart.subtotal} ? Commented Feb 22, 2013 at 2:51

1 Answer 1

1

First change entries like <p><option value="1"</p>Free Delivery</option> to

<option value="1">Free Delivery</option>

Secondly if you use jQuery to bind action then the jQuery code should be:

$("select[name='delivery']").change(function() {
//do something here
});

Also remove unnecessary space

from <select name ="delivery ">

change it to <select name ="delivery">

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.