I have two select form fields. One is the “price_from”, the other is “price_to”. The problem is that I want to prevent the user for selecting for example price_from “10000” and price_to “1000”, so basically I must find some javascript function which sets the “price_to” field values based on “price_to” values onwards. ie : If I select the price_from =”3000″, the price_from field will display values from “4000”. And ofcourse vice-versa. If somebody changes the “price_to” or “price_from” field again.
Share
Try this:
HTML:
JavaScript:
jsFiddle: http://jsfiddle.net/davidbuzatto/YNL6R/
Edit: I inserted a custom atribute in each select to denote the select that they are binded.