Skip to content

Instantly share code, notes, and snippets.

@mrcodefinger
Last active September 22, 2020 06:16
Show Gist options
  • Save mrcodefinger/cfbeb316b4dfb3e0257a052fa18e37cc to your computer and use it in GitHub Desktop.
Save mrcodefinger/cfbeb316b4dfb3e0257a052fa18e37cc to your computer and use it in GitHub Desktop.
$('input[name="number_rooms__to"]').on('change', function () {
$('input[name="number_rooms__of"]').attr('max', $(this).val() - 1);
});
$('input[name="number_rooms__of"]').on('change', function () {
$('input[name="number_rooms__to"]').attr('min', parseInt($(this).val()) + 1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment