SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2002
    Location
    Miami Fl
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Html 4.01 Strict

    What would be the proper syntax for this particular tag to validate as HTML 4.01/STRICT:

    <form action="" name="webcam" >

    The w3 validator barks over the last portion of the form code where it shows: 'name="webcam"' The name tag is essential for this particular javascript snippet:

    document.form1.clock.value = x;

    Any suggestions?
    -= Eric

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe you would need to use an "ID" ala CSS.

    <style type="text/css">
    <!--

    #webcam { some properties; }

    -->
    </style>

    <form id="webcam">

    Then you can use the DOMs GetElementByID to change any attributes of the selected element.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Member
    Join Date
    Jun 2002
    Location
    Miami Fl
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry *grumble*

    No that wouldn't quite work. There are two instances where a name would be required for this particular Javascript.

    [VBS]

    <script type="text/Javascript">
    <!--
    var x = 30;
    var y = 1;
    var now;


    function startClock() {
    x = x-y;
    document.form1.clock.value = x;
    if (x <= 1) reload();
    timerID = setTimeout("startClock()", 1000);
    }

    function reload() {
    now = new Date();
    var camImg = "wcam/home.jpg" + "?" + now.getTim();
    document.campicture.src = camImg;
    x = 30;
    document.form1.clock.value = x;
    }
    // -->
    </script>

    [/VBS]

    How would I rewrite that so that it wouldn't /need/ the name tag and reference instead the id tag? I am so /NOT/ a javascript person.

    I'm close to ditching the entire Javascript portion and using a meta refresh. *sigh*
    -= Eric


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
  •