#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    behind the computer
    Posts
    18
    Rep Power
    0

    javascript problem


    Can somebody please explain what this thing does? I got the error spanobj = empty or no object

    spanObj = document.all.start_day;
  2. #2
  3. // no comment
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2001
    Posts
    1,645
    Rep Power
    39
    i believe it means there's no element named start_day in the document, or if there is, it doesn't hold any value; can you show your code?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    behind the computer
    Posts
    18
    Rep Power
    0
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    <html>
    <head>
    <title>Untitled</title>
    <script language="javascript" type="text/javascript">
    function updateWday(span)
    {
    wdays = new Array(
    'Zondag',
    'Maandag',
    'Dinsdag',
    'Woensdag',
    'Donderdag',
    'Vrijdag',
    'Zaterdag'
    );
    if (span == 'start_wday') {
    if (document.all) {
    spanObj = document.all.start_wday;
    } else {
    spanObj = document.getElementById('start_wday');
    }
    day = document.event.dagvan.value;
    month = document.event.maandvan.value - 1;
    year = document.event.jaarvan.value;
    } else if (span == 'end_wday') {
    if (document.all) {
    spanObj = document.all.end_wday;
    } else {
    spanObj = document.getElementById('end_wday');
    }
    day = document.event.dagtot.value;
    month = document.event.maandtot.value - 1;
    year = document.event.jaartot.value;
    } else if (span == 'recur_end_wday') {
    if (document.all) {
    spanObj = document.all.recur_end_wday;
    } else {
    spanObj = document.getElementById('recur_end_wday');
    }
    day = document.event.recur_enddate_day.value;
    month = document.event.recur_enddate_month.value - 1;
    year = document.event.recur_enddate_year.value;
    }
    date = new Date(year, month, day)
    spanObj.innerHTML = '(' + wdays[date.getDay()] + ')';
    }
    </script>
    </head>

    <body>
    <form action="savecursus.php" method="post" name="event">
    cursus:<select name="titel">
    <option value="1" SELECTED> kies hier de cursus</option>
    <option value="introduction to J2EE">introduction to J2EE</option>
    <option value="E-business">E-business</option>
    </select><br>
    plaats:<input type="text" name="plaats"><br>
    datum: van <select name="dagvan" onchange="updateWday('start_wday');">
    <option value="1" SELECTED>dag</option>
    <option value="01">01</option>
    <option value="02">02</option>
    <option value="03">03</option>
    <option value="04">04</option>
    <option value="05">05</option>
    <option value="06">06</option>
    <option value="07">07</option>
    <option value="08">08</option>
    <option value="09">09</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20">20</option>
    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23">23</option>
    <option value="24">24</option>
    <option value="25">25</option>
    <option value="26">26</option>
    <option value="27">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
    </select>
    - <select name="maandvan" onchange="updateWday('start_wday');">
    <option value="1" SELECTED>maand</option>
    <option value="01">01</option>
    <option value="02">02</option>
    <option value="03">03</option>
    <option value="04">04</option>
    <option value="05">05</option>
    <option value="06">06</option>
    <option value="07">07</option>
    <option value="08">08</option>
    <option value="09">09</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    </select>
    - <select name="jaarvan" onchange="updateWday('start_wday');">
    <option value="1" SELECTED>jaar</option>
    <option value="2002">2002</option>
    <option value="2003">2003</option>
    <option value="2004">2004</option>
    </select>&nbsp;&nbsp;&nbsp;&nbsp;<span id="end_wday"></span>
    <script language="javascript" type=text/javascript">
    updateWday('end_wday');
    </script>
    tot: <select name="dagtot" onchange="updateWday('recur_end__wday');">
    <option value="1" SELECTED>dag</option>
    <option value="01">01</option>
    <option value="02">02</option>
    <option value="03">03</option>
    <option value="04">04</option>
    <option value="05">05</option>
    <option value="06">06</option>
    <option value="07">07</option>
    <option value="08">08</option>
    <option value="09">09</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20">20</option>
    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23">23</option>
    <option value="24">24</option>
    <option value="25">25</option>
    <option value="26">26</option>
    <option value="27">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
    </select>
    - <select name="maandtot" onchange="updateWday('recur_end__wday');">
    <option value="1" SELECTED>maand</option>
    <option value="01">01</option>
    <option value="02">02</option>
    <option value="03">03</option>
    <option value="04">04</option>
    <option value="05">05</option>
    <option value="06">06</option>
    <option value="07">07</option>
    <option value="08">08</option>
    <option value="09">09</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    </select>
    - <select name="jaartot" onchange="updateWday('recur_end__wday');">
    <option value="1" SELECTED>jaar</option>
    <option value="2002">2002</option>
    <option value="2003">2003</option>
    <option value="2004">2004</option>
    </select><span id="recur_end_wday">
    </span>
    <script language="javascript" type=text/javascript">
    updateWday("recur_end_wday");
    </script>
    <br>
    <input type="submit" value="submit">
    </form>


    </body>
    </html>
    this is the whole code, it's supposed to check what day a date is.
    but it seems to have an error
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Posts
    7
    Rep Power
    0
    I saw u have span object with following ID's:
    end_wday
    recur_end_wday
    and u don't have any span object witch id is start_wday
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    behind the computer
    Posts
    18
    Rep Power
    0
    ow i see, damn how long can you look at a script without seeing the bug
    thanks for the reply
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Posts
    7
    Rep Power
    0
    np
    it was pleasure : ))))))))))))))
    (BTW,sorry 4 my english,but I'm doing my best)

    MoshMislit

IMN logo majestic logo threadwatch logo seochat tools logo