Object doesn't support this property or method - Internet Explorer 8

Object doesn't support this property or method - Internet Explorer 8

I get the following error for a page that is basically a form.  After filling in the form and click the save button, IE gives me this error. 

Object doesn't support this property or method. 
Line:497
Char:5

Can anyone please take a look and tell me what it could be?

line 497 is the 6th from the bottom... jQuery_1_7_1("#store_notes").val( "" ) ;

Here's the code...


  1. <?php
        include_once ( "../global/includes/settings.php" );
        $current_opt_menu = $opt_menu_checklist;
        include_once ( "includes/header.php" );
        include_once ( "../global/includes/functions.php" );
           
        // if no param, redirect to mailbox list
        if ( $_REQUEST['id_mailbox'] == '' ) {
            ?><script>window.location = "manage-mailboxes.php";</script><?php
        }
       
        // get param id
        $lIdMailbox = sanitizeQuery( $_REQUEST['id_mailbox'] );
       
        // load mailbox info
        $query = "SELECT *, DATE_FORMAT( renewal_date, '%m-%d-%Y') as a_renewal_date
                            FROM ".$prefix."_mailbox
                            WHERE id_mailbox  = ".$lIdMailbox;
        $data = mysql_query( $query );
        $row = mysql_fetch_array( $data );
       
        // check if mailbox belongs to user and if not, redirect to mailbox list
        if ( $row['id_user'] <> $_SESSION["login_user_id"] ) {
            ?><script>window.location = "manage-mailboxes.php";</script><?php
        }
    ?>
        <!-- datepicker -->
      <link rel="stylesheet" href="../global/styles/jquery/base/jquery.ui.all.css">
        <script type="text/javascript" src="../global/js/jquery.ui.core.js"></script>
        <script type="text/javascript" src="../global/js/jquery.ui.widget.js"></script>   
        <script type="text/javascript" src="../global/js/jquery.ui.datepicker.js"></script>
        <!-- datepicker --><div class="wrapper fullwidth" id='wrapper_main'>
        <div class="center">
      <div id="main">
     
     
     
        <?php if ( $_SESSION["login_member_since"] <= 7 ) { ?>
      <!-- yellow box -->
      <div class="formRowYellow">Please go through the <a href="punchlist.php">account punch list </a> to get you started.</div>
      <!-- yellow box -->
        <?php } ?>
     
      <!-- errors -->
      <div class="formRowError" style="display: none">&nbsp;</div>
      <!-- errors -->
     
      <br />
     
      <!-- content -->
        <div class="mainContent" style="min-height: 400px">
        <h1>Boxholder Profile for Mailbox # <?php echo $row['mailbox_no']; ?></h1>
        <div class="formContent"  style="background: #ebebec"><br />
        <p><b>Set Occupied Status:</b></p>
       
        <div class="formRowSmall">
         
          <div class="mailboxDetailsRowRight">
              <input type="radio" id="rental_status_rented" name="rental_status" value="1" style="width: 10px" <?php echo ( ( $row['rental_status'] == '1' ) ? 'checked="checked"' : ''); ?>/>
            <label for="rental_status_rented">Rented</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <input type="radio" id="rental_status_vacant" name="rental_status" value="0" style="width: 10px" <?php echo ( ( $row['rental_status'] == '0' ) ? 'checked="checked"' : ''); ?>/>
            <label for="rental_status_vacant">Vacant</label>
          </div>
          <div class="mailboxDetailsRowRight" style="margin-left: 20px">
          Marking the mailbox as vacant will delete all customer's details. You must also click the <br />
          button save at the bottom. If you accedently marked the mailbox as vacant simply click<br />
          the back button on your browser without saving and your cusotmer's details won't be deleted. </div>
        </div>
       
       
        <!-- Customer Details -->
        <p><b>Customer Details </b></p>
        <div class="formRowSmall">
          <div class="mailboxDetailsRowLeft">Name (Last, First):</div>
          <div class="mailboxDetailsRowRight"><input type="text" id="customer_name" value="<?php echo $row['customer_name']; ?>" class="formRowInputGreySmall"/></div>
        </div>
        <div class="formRowSmall">
          <div class="mailboxDetailsRowLeft">Home Address:</div>
          <div class="mailboxDetailsRowRight"><input type="text" id="customer_address" value="<?php echo $row['customer_address']; ?>" class="formRowInputGreySmall"/></div>
        </div>
        <div class="formRowSmall">
          <div class="mailboxDetailsRowLeft">City, State, Zip:</div>
          <div class="mailboxDetailsRowRight"><input type="text" id="customer_zip" value="<?php echo $row['customer_zip']; ?>" class="formRowInputGreySmall"/></div>
        </div>
        <div class="formRowSmall">
          <div class="mailboxDetailsRowLeft">Home Phone:</div>
          <div class="mailboxDetailsRowRight"><input type="text" id="customer_home_phone" value="<?php echo $row['customer_home_phone']; ?>" class="formRowInputGreySmall"/></div>
          <div class="mailboxDetailsRowRight" style="margin-left: 30px">Example (555) 123-5555</div>
        </div>
       
        <br />
        <div class="formRowSmall">
          <div class="mailboxDetailsRowLeft">Business Name:</div>
          <div class="mailboxDetailsRowRight"><input type="text" id="business_name" value="<?php echo $row['business_name']; ?>" class="formRowInputGreySmall"/></div>
        </div>
        <div class="formRowSmall">
          <div class="mailboxDetailsRowLeft">Business Address:</div>
          <div class="mailboxDetailsRowRight"><input type="text" id="business_address" value="<?php echo $row['business_address']; ?>" class="formRowInputGreySmall"/></div>
        </div>
        <div class="formRowSmall">
          <div class="mailboxDetailsRowLeft">City, State, Zip:</div>
          <div class="mailboxDetailsRowRight"><input type="text" id="business_zip" value="<?php echo $row['business_zip']; ?>" class="formRowInputGreySmall"/></div>
        </div>
        <div class="formRowSmall">
          <div class="mailboxDetailsRowLeft">Business Phone:</div>
          <div class="mailboxDetailsRowRight"><input type="text" id="business_phone" value="<?php echo $row['business_phone']; ?>" class="formRowInputGreySmall"/></div>
        </div>
        <!-- Customer Information -->
        <br />
     </div>
        <!-- Notification Preferences -->
    <br />
        <h2>Alert Settings </h2>
    <div class="formContent">
          <br />
          <p><em>Send <strong>EMAIL</strong> alerts to this customer when they receive:</em> </p>
        <div class="formRowSmall" style="margin-bottom: 5px">
            <div class="mailboxDetailsRowLeft" style="margin-left: 60px">
                <input type="checkbox" id="notify_email_package" value="1" class="notification_option" <?php echo ( ( $row['notify_email_package'] == 1 ) ? 'checked="checked"' : ''); ?>/>
          </div>
            <div class="mailboxDetailsRowRight">
                <label for="notify_email_package"> Package delivery.</label>
               
          </div>
        </div>
         <div class="formRowSmall" style="margin-bottom: 5px">
            <div class="mailboxDetailsRowLeft" style="margin-left: 60px">
                <input type="checkbox" id="notify_email_mail" value="1" class="notification_option" <?php echo ( ( $row['notify_email_mail'] == 1 ) ? 'checked="checked"' : ''); ?>/>
          </div>
            <div class="mailboxDetailsRowRight">
                <label for="notify_email_mail"> New Mail delivery.</label>
          </div>
        </div>
       
        <div class="formRowSmall">
          <div class="mailboxDetailsRowLeft"><strong>Email:</strong></div>
          <div class="mailboxDetailsRowRight"><input type="text" id="customer_email" value="<?php echo $row['customer_email']; ?>" class="formRowInputGreySmall"/></div>
          <div class="mailboxDetailsRowRight" style="margin-left: 30px">
          Email address to send alerts to. You may enter <br />
           more than one email separated by commas.</div>
        </div>
        <p><em>Send <strong>SMS</strong> text alerts to this customer when they receive:</em></p>
        <div class="formRowSmall" style="margin-bottom: 5px">
            <div class="mailboxDetailsRowLeft" style="margin-left: 60px">
                <input type="checkbox" id="notify_text_package" value="1" class="notification_option" <?php echo ( ( $row['notify_text_package'] == 1 ) ? 'checked="checked"' : ''); ?>/>
          </div>
            <div class="mailboxDetailsNotificationRowRight">
                <label for="notify_text_package"> Package delivery.</label>
          </div>
        </div>
      
        <div class="formRowSmall">
            <div class="mailboxDetailsRowLeft" style="margin-left: 60px">
                <input type="checkbox" id="notify_text_mail" value="1" class="notification_option" <?php echo ( ( $row['notify_text_mail'] == 1 ) ? 'checked="checked"' : ''); ?>/>
          </div>
            <div class="mailboxDetailsNotificationRowRight">
                <label for="notify_text_mail"> New Mail delivery.</label>
          </div>
        </div>
       
        <div class="formRowSmall">
          <div class="mailboxDetailsRowLeft"><strong>Mobile Phone:</strong></div>
          <div class="mailboxDetailsRowRight"><input type="text" id="customer_mobile_phone" value="<?php echo $row['customer_mobile_phone']; ?>" class="formRowInputGreySmall"/></div>
          <div class="mailboxDetailsRowRight" style="margin-left: 30px">Mobile number to send text message alerts.</div>
        </div>
        <br />
    </div>
        <!-- Notification Preferences -->
       
        <br />
       
        <!-- Customer Information -->
        <h2>Mailbox Rental Details</h2>
        <div class="formContent"  style="background: #ebebec"><br />
        <div class="formRowSmall">
          <div class="mailboxDetailsRowLeft">Mailbox Size:</div>
          <div class="mailboxDetailsRowRight">
              <select id="id_mailbox_size" name="id_mailbox_size" class="formRowSelectGrey">
              <option value="">Select Size...</option>
              <?php
                            $query = "SELECT id_mailbox_size, name
                                                FROM ".$prefix."_mailbox_size
                                                WHERE id_user = ".$_SESSION["login_user_id"]."
                                                ORDER BY name";
                            $dataDetails = mysql_query( $query );
                            $lRentalOptions = "";
                            while ( $rowDetails = mysql_fetch_array( $dataDetails ) ) {
                                if ( $rowDetails['id_mailbox_size'] == $row['id_mailbox_size'] )
                                    $lSelected = 'selected="selected"';
                                else
                                    $lSelected = '';
                                echo '<option value="'.$rowDetails['id_mailbox_size'].'" '.$lSelected.'>'.$rowDetails['name'].'</option>';
                            }
                        ?>
            </select>
          </div>
        </div>
        <div class="formRowSmall">
          <div class="mailboxDetailsRowLeft">Rental Period:</div>
          <div class="mailboxDetailsRowRight">
              <select id="id_rental_period" name="id_rental_period" class="formRowSelectGrey">
              <option value="">Please Select...</option>
              <?php
                            $query = "SELECT mp.id_rental_period, rp.name
                                                FROM ".$prefix."_mailbox_period mp
                                                INNER JOIN ".$prefix."_rental_period rp ON rp.id_rental_period = mp.id_rental_period
                                                WHERE mp.id_user = ".$_SESSION["login_user_id"]."
                                                ORDER BY rp.months";
                            $dataDetails = mysql_query( $query );
                            $lRentalOptions = "";
                            while ( $rowDetails = mysql_fetch_array( $dataDetails ) ) {
                                if ( $rowDetails['id_rental_period'] == $row['id_rental_period'] )
                                    $lSelected = 'selected="selected"';
                                else
                                    $lSelected = '';
                                echo '<option value="'.$rowDetails['id_rental_period'].'" '.$lSelected.'>'.$rowDetails['name'].'</option>';
                            }
                        ?>
            </select>
          </div>
        </div>
        <div class="formRowSmall">
          <div class="mailboxDetailsRowLeft">Renewal Date:</div>
          <div class="mailboxDetailsRowRight"><input type="text" id="renewal_date" value="<?php echo $row['a_renewal_date']; ?>" class="formRowInputGreySmall"/></div>
        </div>
        <div class="formRowSmall">
          <div class="mailboxDetailsRowLeft">Price Override:</div>
          <div class="mailboxDetailsRowRight">
              <input type="text" id="price_override" value="<?php echo $row['price_override']; ?>" class="formRowInputGreySmall" onKeyPress="return numbersandotonly(this, event)"/>
          </div>
          <div class="mailboxDetailsRowRight" style="margin-left: 30px">This price will override your default price schedule.</div>
        </div>
        <div class="formRowSmall">
          <div class="mailboxDetailsRowLeft">Store Notes:</div>
          <div class="mailboxDetailsRowRight"><textarea id="store_notes"><?php echo $row['store_notes']; ?></textarea></div>
        </div>
        <!-- Customer Information -->
       
        <br />
               
        <div class="formRowSmall">
          <div class="mailboxDetailsButton"><img id="save_button" src="images/buttons/save-btn.gif" style="cursor: pointer"/></div>
        </div>
       
        <p><a href="print/print-mailbox-qrcode.php?mailbox_no=<?php echo $row['mailbox_no']; ?>" target="_blank"><img src="images/small-QR-code.jpg" alt="print QR code" width="32" height="32" hspace="5" border="0" />Print an individual QR code for this mailbox</a>. (See the help page for more info on scanning QR codes)</p>
       
        <br />
      </div> 
     
      <br /><br />
      </div>
      <!-- content -->
     
      <script>
        /*
        $("input").click( function(e) {
            alert();
            e.preventDefault();
        })
        */
        jQuery(document).ready(function( $ ) {
            jQuery( "#renewal_date" ).datepicker({ dateFormat: "mm-dd-yy" });       
            //alert(jQuery_1_7_1.ui);
        });
       
            ///////////////////////////////////////////////////////////
            // save
            ///////////////////////////////////////////////////////////
            jQuery_1_7_1("#save_button").click( function() {
                var lErrorMsg = checkMandatoryFields();
                // if there's no errors, submit
                if ( lErrorMsg == '' ) {
                    saveData();
                } else {
                    // if not, show errors
                    jQuery_1_7_1(".formRowError").html( lErrorMsg + '<br><br>' );
                    jQuery_1_7_1(".formRowError").fadeIn();
                    var new_position = jQuery_1_7_1('.formRowError').offset();
                window.scrollTo(new_position.left,new_position.top);
                }
            });
               
            function saveData() {   
                // check checkbox values
                if ( jQuery_1_7_1("#notify_email_package").attr("checked") == "checked" )
                    notify_email_package = 1;
                else
                    notify_email_package = 0;
                if ( jQuery_1_7_1("#notify_text_package").attr("checked") == "checked" )
                    notify_text_package = 1;
                else
                    notify_text_package = 0;
                if ( jQuery_1_7_1("#notify_email_mail").attr("checked") == "checked" )
                    notify_email_mail = 1;
                else
                    notify_email_mail = 0;
                if ( jQuery_1_7_1("#notify_text_mail").attr("checked") == "checked" )
                    notify_text_mail = 1;
                else
                    notify_text_mail = 0;
                   
                // check radio values
                if ( jQuery_1_7_1("#rental_status_rented").attr("checked") == "checked" )
                    rental_status = 1;
                else if ( jQuery_1_7_1("#rental_status_vacant").attr("checked") == "checked" )
                    rental_status = 0
                else
                    rental_status = '';
           
                var dataString = 'id_mailbox=<?php echo $lIdMailbox; ?>' +
                                                    '&mailbox_no=<?php echo $row['mailbox_no']; ?>' +
                                                    '&customer_name=' + jQuery_1_7_1("#customer_name").val() +
                                                    '&customer_address=' + jQuery_1_7_1("#customer_address").val() +
                                                    '&customer_zip=' + jQuery_1_7_1("#customer_zip").val() +
                                                    '&customer_home_phone=' + jQuery_1_7_1("#customer_home_phone").val() +
                                                    '&customer_mobile_phone=' + jQuery_1_7_1("#customer_mobile_phone").val() +
                                                    '&customer_email=' + jQuery_1_7_1("#customer_email").val() +
                                                    '&business_name=' + jQuery_1_7_1("#business_name").val() +
                                                    '&business_address=' + jQuery_1_7_1("#business_address").val() +
                                                    '&business_zip=' + jQuery_1_7_1("#business_zip").val() +
                                                    '&business_phone=' + jQuery_1_7_1("#business_phone").val() +
                                                    '&notify_email_package=' + notify_email_package +
                                                    '&notify_text_package=' + notify_text_package +
                                                    '&notify_email_mail=' + notify_email_mail +
                                                    '&notify_text_mail=' + notify_text_mail +
                                                    '&id_mailbox_size=' + jQuery_1_7_1("#id_mailbox_size").val() +
                                                    '&rental_status=' + rental_status +
                                                    '&id_rental_period=' + jQuery_1_7_1("#id_rental_period").val() +
                                                    '&renewal_date=' + jQuery_1_7_1("#renewal_date").val() +
                                                    '&price_override=' + jQuery_1_7_1("#price_override").val() +
                                                    '&store_notes=' + jQuery_1_7_1("#store_notes").val();
                jQuery_1_7_1.ajax({
                    type: "POST",
                    url: "data/update-mailbox.php",
                    data: dataString,
                    success: function(data) {
                        // go back to list
                        window.location = "manage-mailboxes.php";
                    }
                });
            }
           
           
            function checkMandatoryFields() {
                var lOk = true;
                var lErrorMsg = "";
               
               
                // check if email is valid
                var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
                var lEmailValid = emailReg.test( jQuery_1_7_1('#customer_email').val() );
                // if email is not valid
                if (!lEmailValid) {
                    lOk = false;
                    lErrorMsg = lErrorMsg + "<br>The email address is not valid.";
                }
               
                // check if email notification is active but there's no email
                if ( ( ( jQuery_1_7_1("#notify_email_package").attr("checked") == "checked" ) || ( jQuery_1_7_1("#notify_email_mail").attr("checked") == "checked" ) ) &&
                ( ( jQuery_1_7_1("#customer_email").val() == undefined ) || ( jQuery_1_7_1("#customer_email").val() == '' ) ) ) {
                    lOk = false;
                    lErrorMsg = lErrorMsg + "<br>You must enter an email address or uncheck the email alert settings.";
                }
               
                // check if email notification is active but there's no email
                if ( ( ( jQuery_1_7_1("#notify_text_package").attr("checked") == "checked" ) || ( jQuery_1_7_1("#notify_text_mail").attr("checked") == "checked" ) ) &&
                ( ( jQuery_1_7_1("#customer_mobile_phone").val() == undefined ) || ( jQuery_1_7_1("#customer_mobile_phone").val() == '' ) ) ) {
                    lOk = false;
                    lErrorMsg = lErrorMsg + "<br>You must enter a mobile number or uncheck the sms alert settings.";
                }
               
                return lErrorMsg;
            }
           
            ///////////////////////////////////////////////////////////
            // if user changes to vacant, clear all info
            ///////////////////////////////////////////////////////////
            jQuery_1_7_1("#rental_status_vacant").click( function() {
                jQuery_1_7_1("#customer_name").val( "" ) +
                jQuery_1_7_1("#customer_address").val( "" ) +
                jQuery_1_7_1("#customer_zip").val( "" ) +
                jQuery_1_7_1("#customer_home_phone").val( "" ) +
                jQuery_1_7_1("#customer_mobile_phone").val( "" ) +
                jQuery_1_7_1("#customer_email").val( "" ) +
                jQuery_1_7_1("#business_name").val( "" ) +
                jQuery_1_7_1("#business_address").val( "" ) +
                jQuery_1_7_1("#business_zip").val( "" ) +
                jQuery_1_7_1("#business_phone").val( "" ) +
                jQuery_1_7_1("#notify_email_package").attr("checked", false ) +
                jQuery_1_7_1("#notify_text_package").attr("checked", false ) +
                jQuery_1_7_1("#notify_email_mail").attr("checked", false ) +
                jQuery_1_7_1("#notify_text_mail").attr("checked", false ) +
                jQuery_1_7_1("#id_mailbox_size").val( "" ) +
                jQuery_1_7_1("#id_rental_period").val( "" ) +
                jQuery_1_7_1("#renewal_date").val( "" ) +
                jQuery_1_7_1("#price_override").val( "" ) +
                jQuery_1_7_1("#store_notes").val( "" ) ;
            });
        </script>
     
    </div></div></div>
    <?php include_once ( "includes/footer.php" ); ?>