SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru hifigrafix's Avatar
    Join Date
    Oct 2005
    Location
    Nashville, TN
    Posts
    628
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE8 - Dynamically Loaded Form Input Value Undefined

    I've got a simple script that works in Firefox, Safari and Chrome. In IE 8 the val() of the input is returning as undefined.

    Essentially I'm loading a form dynamically that offers select boxes for Year - Month - Day - Time. Depending on which date you choose - The month and days offer selectable months / days that the user can schedule a tour.

    When you change year for instance I use $.get to pass the variable of the year select to build the rest of the form accordingly. They dynamically loaded forms are then NOT accessable by jQuery.

    HTML Code:
    $("#select_month").live("change", function() {
    		$("#tour_time").html("<img src='images/294.gif' alt='loading' />");
    		var year = $("#select_year").val();
    		var month = $("#select_month").val();
    		var id = $(".center_check").attr("id");
    
     alert(month+" - "+year);
    
    		$.get("tourTimes.php", {year:year, month:month, center:id, mode:"monthChange"}, function(data) {
    			$("#tour_time").html(data);
    		});
    
    	});
    In this case year and month select values are undefined.

  2. #2
    SitePoint Guru hifigrafix's Avatar
    Join Date
    Oct 2005
    Location
    Nashville, TN
    Posts
    628
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry - I found the problem. I'm an idiot and was adding a loading graphic before I grabbed my values. Evidently by the time the values were attempted to be grabbed they were already replaced by the loading graphic.

    Hope this helps someone else in the future.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •