forms - IE 9, 8 and 7 jquery custom light box does not appear -
i created custom light box appear 2 buttons, user must click 1 , submit form. here code
function lightboxrefferal(){ //$('body').append('<div class="lightbox" id="lightboxbg"></div>'); $('#lightboxbg').height($('body').height()); $('.lightbox').show(); $('#lightboxcontent').show(); $('#lightboxcontent').css("position", "absolute"); $('#lightboxcontent').css("top", math.max(0, (($(window).height() - $('#lightboxcontent').outerheight()) / 2) + $(window).scrolltop()) + "px"); $('#lightboxcontent').css("left", math.max(0, (($(window).width() - $('#lightboxcontent').outerwidth()) / 4) + $(window).scrollleft()) + "px"); $('#referral_dropdown').change(function(){ if($(this).val() == 'friend'){ $('.referral_friend').show(); } else{ $('.referral_friend').hide(); } }); $('#lightboxskip').click(function(){ $('#lightboxcontent').hide(); $('.lightbox').hide(); $('#customers_referral').val('nodata'); $('form[name=create_account]').submit(); }); $('#lightboxcontinue').click(function(){ $('#lightboxcontent').hide(); $('.lightbox').hide(); if($('#referral_dropdown').val() == 'friend'){ $('#customers_referral').val($('#referral_friend_dropdown').val()); }else{ $('#customers_referral').val($('#referral_dropdown').val()); } $('form[name=create_account]').submit(); }); }
in browser works perfectly, lightbox appears, user clicks button , form submitted, problem in ie 9, 8 , 7 lightbox not appear , submits form anyways. wrong code? if remove .submit();
lightbox appears. here html
<div id="lightboxmaincontent"> <fieldset class="referral_lightbox"> <label class="inputlabel" for="referral_dropdown">how did hear us?</label> <select id="referral_dropdown" name="referral_dropdown"> <option>newspaper</option> <option>google</option> <option>friend</option> </select> </fieldset> <fieldset class="referral_friend" style="display:none;"> <label class="inputlabel" for="referral_friend_dropdown">referral:</label> <?php $referralfriendarray = zen_get_referral_info(); //$referralfriendarray = array("first friend", "second friend", "third friend"); ?> <select id="referral_friend_dropdown" name="referral_friend_dropdown"> <?php foreach($referralfriendarray $row => $value){ echo '<option value="'.$row.'">' . $value . '</option>'; } ?> </select> <br class="clearboth" /> </fieldset> </div> <div class="lightboxbuttons"> <input type="button" name="lightboxskip" id="lightboxskip" value="skip" style="width:100px;"> <input type="button" name="lightboxcontinue" id="lightboxcontinue" value="continue" style="width:100px;"> </div> </div>
Comments
Post a Comment