Created
August 2, 2011 16:49
-
-
Save aphoenix/1120632 to your computer and use it in GitHub Desktop.
IE is a pain in the butt.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#pocodesubmit").click(function(event) { | |
event.preventDefault(); | |
var postalcode = $('#areaField').val().toUpperCase().replace(/ /g,''); | |
var regexObj = { canada : /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ]()?\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i}; | |
var regexp = new RegExp(regexObj.canada); | |
if (!regexp.test(postalcode)) { // This one triggers properly in IE. | |
$('.title').html('Please Enter a Postal Code'); | |
} else { // This one does not trigger properly in IE. | |
alert('sending'); | |
var thesearch = 'txt_search='+postalcode; | |
$.ajax({ | |
type:"POST", | |
url:"<?php echo $this->getThemePath()?>/includes/elements/action_iya.php", | |
data:thesearch, | |
success: function() { | |
$('.title').html('Updating your Information'); | |
$('.pcode').html(postalcode); | |
$('.inYourArea').addClass('hide'); | |
$('.inYourArea.current').removeClass('hide').addClass('visible'); | |
$.cookie('iya_postalcode', postalcode, {path: '/'}); | |
location.reload(); | |
} | |
}); | |
} | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment