0

Yes, I know there are many posts on this subject, I've read a great majority of them, but to no avail. This works coming from the external file,

$(document).ready(function () {  
 alert("Ready")
 });

but this doesn't,

$(document).ready(function () {  
$('#<%=RadioButtonList1.ClientID %> input').change(function () { 
  $("#HiddenField1").val((this).value); //places selected value in HiddenField1
  });
});

$(document).ready(function () {  
$("#Button1").mouseenter(function () { //see if Texture and Color Selections were made
    var z = $("#HiddenField1").val(); //
    //alert(z)
    if (z != "xx") { // a Product was chosen
        var t = $("#DropDownList1").val(); // Texture
        if (t == "Choose a Texture") {
            alert("Please Choose a Texture")
        }; /// end if 
        var c = $("#DropDownList2").val(); // Color
        if (c == "Choose a Color") {
            alert("Please Choose a Color")
        }; /// end if 
    }; /// end if  
  }); /// end function
}); /// end Ready

In fact they work directly in the page without the $(document).ready(function () { while it doesn't work at all either way in the external file. An interesting tidbit, in the #<%=RadioButtonList1.ClientID %> input') the <% and %> are not yellow in the external file while they are as seen if directly on the page. I know I am firing the external file as evidenced by the simple $(document).ready(function alert("Ready") working. What am I missing, thank you.

NitroMuse
  • 7
  • 2
  • which is the sequence of your files ? I think you jquery is loaded after thuis file – Suren Srapyan Aug 04 '16 at 14:05
  • @SurenSrapyan The `alert` works, so jQuery is loaded. – 4castle Aug 04 '16 at 14:09
  • `Js` files are compiled by browser. `Aspx` by server. Server understands that it is a server control and server control has `ClientID` poperty. Browser doesn't understand that. – ManojAnavatti Aug 04 '16 at 15:14
  • Thanks everyone, while this did not solve my problem it let's me know not to spend anymore time on it since it is a known issue per the 'possible duplicate' posting. I'll mark this as resolved and see if there is another way I can attack this. – NitroMuse Aug 04 '16 at 17:12

0 Answers0