SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    May 2004
    Location
    Atlanta
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XHTML Strict Javascript and Form ID

    I am trying to right form with XHTML strict.
    Can anyone suggest how to change javascript names to ids.
    I have following script:

    Code:
    function changeImageInfo(imageURL,title)
    		{
    		document.big_image.src = imageURL;
    		document.image_form.image_title.value = title;
    		}

    Would it be right if I will change it to:
    Code:
    function changeImageInfo(imageURL,title)
    		{
    		document.getElementById('big_image').src = imageURL;
    		document.getElementById('image_form');
    		document.getElementById('image_title').value = title;
    		}

  2. #2
    SitePoint Zealot colinr's Avatar
    Join Date
    Aug 2003
    Location
    san francisco, ca
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    are you trying to get the script to work? or are you trying to get the xhtml to validate
    Web Slave

  3. #3
    SitePoint Member Got2bMe's Avatar
    Join Date
    Jan 2004
    Location
    Florida
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by colinr
    are you trying to get the script to work? or are you trying to get the xhtml to validate
    I'm trying to validate an xhtml 1.0 strict doc that contains javascript but since "language" is not an xhtml attribute I'm stuck.
    How do I fix this?

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,478
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    but since "language" is not an xhtml attribute I'm stuck.
    Do you mean this:
    Code:
    <script type="text/javascript"></script>
    Paul

  5. #5
    SitePoint Member Got2bMe's Avatar
    Join Date
    Jan 2004
    Location
    Florida
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B
    Do you mean this:
    Code:
    <script type="text/javascript"></script>
    Paul

    YES! thank you, thank you, thank 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
  •