Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8975925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:00:02+00:00 2026-06-15T19:00:02+00:00

I have a simple program, and it works 100% in Firefox and Chrome, but

  • 0

I have a simple program, and it works 100% in Firefox and Chrome, but it doesn’t work in Internet Explorer (version 9).

A popup window is called from a page that lists all the scheduled appointments for the day. This is the code to that popup window:

<?php

$name = $_GET['name'];
#$type = $_GET['type'];
$type = "Regular";
$id   = $_GET['id'];

?>

<!doctype html>
<html>
    <head>
        <title><?php echo $name; ?></title>
        <style type="text/css">
            body {
                font-family: Georgia;
            }
            .col1 {
                float: left;
                padding-right: .75em;
            }
            .col1 div { height: 1.5em; }
            .col2 div { height: 1.5em; }
            .col2 {
                float: left;
                padding-right: .5em;
            }
            .notes {
                clear: both;
            }
        </style>
        <script type="text/javascript">
            function saveClose() {
                var xmlhttp;
                var getstring  = "";
                var d          = document;

                var start_hour = d.getElementsByName('start_hour')[0].value;
                var start_min  = d.getElementsByName('start_min')[0].value;
                var start_am   = d.getElementsByName('start_am')[0].value;

                var end_hour   = d.getElementsByName('end_hour')[0].value;
                var end_min    = d.getElementsByName('end_min')[0].value;
                var end_am     = d.getElementsByName('end_am')[0].value;

                var no_show    = d.getElementsByName('no_show')[0].checked;

                var notes      = d.getElementsByName('notes')[0].value;

                getstring += "?type=<?php echo $type ?>";
                getstring += "&id=<?php echo $id ?>";
                getstring += "&s_hour="+start_hour;
                getstring += "&s_min=" +start_min;
                getstring += "&s_am="  +start_am;
                getstring += "&e_hour="+end_hour;
                getstring += "&e_min=" +end_min;
                getstring += "&e_am="  +end_am;
                getstring += "&ns="    +no_show;
                getstring += "&notes=" +notes;

                if (window.XMLHttpRequest)
                {
                    // code for IE7+, Firefox, Chrome, Opera, Safari;
                    xmlhttp = new XMLHttpRequest();
                } else {
                    // code for IE6, IE5;
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                }

                xmlhttp.onreadystatechange = function()
                {
                    if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
                    {
                        var reply = xmlhttp.responseText;
                        if (reply == "Successful!") {
                            setTimeout('self.close()', 1000);
                        } else {
                            document.getElementById('resultsContent').innerHTML = xmlhttp.responseText;
                        }
                    } else {
                        document.getElementById('resultsContent').innerHTML = "Saving...";
                    }
                }

                xmlhttp.open("GET", "saveClose.php"+getstring, true);
                xmlhttp.send();
            }
        </script>
    </head>
    <body>
        <div><h2><?php echo $name; ?>'s Consult</h2></div>
        <div class="col1">
            <div>Consult Start Time:</div>
            <div>Consult End Time:</div>
            <div>No Show? :</div>
        </div>
        <div class="col2">
            <div>
                <select name="start_hour">
                    <option></option>
                    <option>1</option>
                    <option>2</option>
                    <option>3</option>
                    <option>4</option>
                    <option>5</option>
                    <option>6</option>
                    <option>7</option>
                    <option>8</option>
                    <option>9</option>
                    <option>10</option>
                    <option>11</option>
                    <option>12</option>
                </select>
                :
                <select name="start_min">
                    <option></option>
                    <option>00</option>
                    <option>05</option>
                    <option>10</option>
                    <option>15</option>
                    <option>20</option>
                    <option>25</option>
                    <option>30</option>
                    <option>35</option>
                    <option>40</option>
                    <option>45</option>
                    <option>50</option>
                    <option>55</option>
                </select>
                -
                <select name="start_am">
                    <option></option>
                    <option>AM</option>
                    <option>PM</option>
                </select>
            </div>
            <div>
                <select name="end_hour">
                    <option></option>
                    <option>1</option>
                    <option>2</option>
                    <option>3</option>
                    <option>4</option>
                    <option>5</option>
                    <option>6</option>
                    <option>7</option>
                    <option>8</option>
                    <option>9</option>
                    <option>10</option>
                    <option>11</option>
                    <option>12</option>
                </select>
                :
                <select name="end_min">
                    <option></option>
                    <option>00</option>
                    <option>05</option>
                    <option>10</option>
                    <option>15</option>
                    <option>20</option>
                    <option>25</option>
                    <option>30</option>
                    <option>35</option>
                    <option>40</option>
                    <option>45</option>
                    <option>50</option>
                    <option>55</option>
                </select>
                -
                <select name="end_am">
                    <option></option>
                    <option>AM</option>
                    <option>PM</option>
                </select>
            </div>
            <div><input type="checkbox" name="no_show" /></div>
        </div>
        <div class="notes">Notes:</div>
        <div class="notes"><textarea name="notes" rows="5" cols="53"></textarea></div>
        <div class="notes"><button type="button" onClick="saveClose();">Save & Close</button><span id="resultsContent" style="padding-left:1em"></span></div>
    </body>
</html>

The AJAX call runs this PHP script:

<?php

$type   = $_GET['type'];
$id     = $_GET['id'];
$s_hour = $_GET['s_hour'];
$s_min  = $_GET['s_min'];
$s_am   = $_GET['s_am'];
$e_hour = $_GET['e_hour'];
$e_min  = $_GET['e_min'];
$e_am   = $_GET['e_am'];
$ns     = $_GET['ns'];
$ns     = (($ns == "true") ? "1" : "0");
$notes  = $_GET['notes'];


switch (true) {
    case empty($type):
        echo "\$type is broken!";
        break;
    case empty($s_hour):
        echo "\$s_hour is broken!";
        break;
    case empty($s_min):
        echo "\$s_min is broken!";
        break;
    case empty($s_am):
        echo "\$s_am is broken!";
        break;
    case empty($e_hour):
        echo "\$e_hour is broken!";
        break;
    case empty($e_min):
        echo "\$e_min is broken!";
        break;
    case empty($e_am):
        echo "\$e_am is broken!";
        break;
    case (!isset($ns)):
        echo "\$ns is broken!";
        break;
    case (!isset($notes)):
        echo "\$notes is broken!";
        break;

    default:
        // SALES APPTS.
        # ...
        # ...
        # ...

        // OTHER APPTS.
        # ...
        # ...
        # ...

        echo "Successful!";
        break;
}


?>

Like expected, Firefox and Chrome halt on every case statement until both the start time and end time are selected. Works perfectly.

IE, however, will halt on case empty($s_hour): every single time, no matter what. I can’t even get past that first case statement to see if the rest are broken too. I do not understand.

Any help would be greatly appreciated, as this application must be IE9 compatible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:00:04+00:00Added an answer on June 15, 2026 at 7:00 pm

    You are trying to read the value of the value of the select boxes, but the ‘value’ property may not be populated as you expect, because it’s trying to get the value property from the selected option, not the text of that option.

    You should either add an explicit value attribute to the <option> elements like so:

    <option value='12'>12</option>
    

    or explicitly get the text of the selected option, like so:

    var objStHr = document.getElementsByName('start_hour')[0];
    var start_hour = objStHr.options[objStHr.value];
    

    (I’ve used a temp var to hold the object for brevity since we have to reference it twice)

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple SAS (version 9.2) program as follows, proc model; cdf('normal',log(V/100)+1)=0.5; bounds
I have a simple program to check if a port is open, but I
I have written a simple program using parallel python, and all works well. However,
Say I have simple program that emulates a board game with a number of
I have Simple java program named MainController.java. Wehn I try to compile it from
I have a simple program. I want to set the path and some properties
I have a simple program that checks webpages for strings, example: Private Sub Button1_Click(ByVal
I have a simple program (written in Java) which uses the google protocol buffer
I have a simple program on windows using visual studios 2008. In my code
I have a simple program which is able to change the background color after

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.