Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var selvalues = $(this).val(); //["AS", "US", "CA"]
- $('#countriesSelect').on('change', function(){
- var selvalues = $(this).val();
- console.log(selvalues .some(x => x !== 'US' && x == 'US'));
- if(selvalues.includes('US') || !selvalues.includes('US')){
- console.log('You cannot choose a foreign country when current selection is US');
- }
- if($.inArray("US",selvalues) != -1){
- $('#usregions').show().fadeIn();
- if($.inArray("US",selvalues) != -1){}
- } else {
- $('#usregions').hide().fadeOut();
- }
- $.each(selvalues, function( index, value ) {
- console.log()
- if(value == 'US' && value != 'US'){
- console.log('You cannot choose a foreign country when current selection is US');
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement