Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery not working in internet explorer using mvc

i have a group of radio buttons that are generated on the fly from the db into a partial control then rendered on the page as html and they all have the same name now in firefox and chrome the following code works fine

$(".FlightSelectedRadio").live('click', function() {
    alert("after flight select");
    $("#ToisGarantueedBid").attr("disabled", false);
});

however in ie it doesnt work on the first select of a radio but only fires if u select something else ? any ideas wat the problem is ?

like image 220
Barry Avatar asked Feb 02 '26 09:02

Barry


1 Answers

Lazarus, is right! The code you are writing should be executed after JQuery's page ready event fires which can be accomplished in two ways.

1) Like Lazarus

$(function() { 
     // your code here.
});

2) Or tying in to the document object ready event.

$(document).ready(
   function() {
       // your code here.
   }
);
like image 155
Roberto Hernandez Avatar answered Feb 04 '26 22:02

Roberto Hernandez



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!