SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Learning...
    Join Date
    Jan 2003
    Posts
    781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jquery UI DatePicker IE problem - Validators Interfering

    ASP.Net 3.5 Application.

    Date picker shows and when i try to click the date, IE 8 (I havent checked other versions) throws "length is null or not an object" error. It puts the date in the text box but then throws error. When i click out side the date picker area, it hides properly without any error. FF behaves properly.

    Error is on the following line in generated webresource_3.axd file (line # 175). When i take out all 3 validators then it works normal.
    Code:
     var i;
        for (i = 0; i < vals.length; i++) {
            ValidatorValidate(vals[i], null, event);
        }
    Page code:

    Head References
    Code:
    <scriptsrc="Scripts/jquery-1.6.2.min.js" type="text/javascript"></script>
    <linkhref="Scripts/jquery.ui/jquery-ui-1.8.7.custom.css" rel="stylesheet" type="text/css" />
    
    <scriptsrc="Scripts/jquery.ui/jquery-ui-1.8.7.custom.js" type="text/javascript"></script>
    Page HTML
    Code:
    <tableid="tbl_control" cellspacing="0" cellpadding="0" border="0">
    <tr>
    <tdalign="center">
    <inputname="ctl00$ContentPlaceHolder1$dtStartDate$txtDate" type="text" value="08/05/2011" size="12" id="ctl00_ContentPlaceHolder1_dtStartDate_txtDate" class="StandardText" />
      </td>
    <tdalign="center">
    <spanid="ctl00_ContentPlaceHolder1_dtStartDate_RegularExpressionValidator1" class="StandardText" style="color:Red;display:none;">Enter valid Date</span>
    <spanid="ctl00_ContentPlaceHolder1_dtStartDate_CompareValidator1" class="StandardText" style="color:Red;display:none;">*</span>
    <spanid="ctl00_ContentPlaceHolder1_dtStartDate_RequiredFieldValidator1" class="StandardText" style="color:Red;display:none;">Date should not be blank</span>
    </td>
    </tr>
    
    </table>
    javascript: ClientID and ResolveUrl utilized to get text box id and image path.
    Code:
    <scripttype="text/javascript"> 
    $(document).ready(function() {
    $(".ui-datepicker-trigger").show(); $('#ctl00_ContentPlaceHolder1_dtStartDate_txtDate').datepicker({
    showOn: 'button', buttonImage: '/Source/images/SmallCalendar.gif', buttonImageOnly: true
    });
    }); </script>
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...

  2. #2
    Learning...
    Join Date
    Jan 2003
    Posts
    781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have also implemented the following and it is resulting in the same problem also:
    http://www.kelvinluck.com/assets/jqu...icker/v2/demo/
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...

  3. #3
    Learning...
    Join Date
    Jan 2003
    Posts
    781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If the day clicked and showing in the text box are the same then i don't have this problem.
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...


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
  •