Kennedy
Kennedy

Reputation: 335

how to reload same page after change the select box option

how to reload same page after change the select box option.

I have to used some shopping cart framework.In this i need to update cart price when i changed product attributes ,

so i need to reload the same page when the select box is onchanged.

<tr><td>
  <select name="color" onchange="">
   <option value="red"> Red </option>
<option value="red"> Blue</option>
<option value="red"> Green</option>
<option value="red"> Pink</option>
</select>
</td></tr>

Upvotes: 5

Views: 47345

Answers (3)

coder
coder

Reputation: 701

You can try this:

<tr>
  <td>
    <select name="color" onchange="location.reload()">
      <option value="red">Red </option>
      <option value="blue">Blue</option>
      <option value="green">Green</option>
      <option value="pink">Pink</option>
    </select>
  </td>
</tr>

Upvotes: 13

Nipun Tyagi
Nipun Tyagi

Reputation: 898

(function($) {
    $(document).ready( function() {
        $('#name').change(function() {
            location.reload();
        });
    });
})(jQuery);

Upvotes: 3

William Buttlicker
William Buttlicker

Reputation: 6000

$('#something').change(function() {
    location.reload();
});

Upvotes: 1

Related Questions