SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru redhillccwebmas's Avatar
    Join Date
    Jun 2005
    Posts
    989
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Validating to XHTML Strict 1.0 - onClick javascript alternative?

    Hi there,

    A snippet of code within part of my form set is not validating. The line of code is:-

    Code:
    <input type="submit" name="Submit" value="Send Message" onClick="MM_validateForm('NAME','','R','E-MAIL','','RisEmail','MESSAGE','','R');return document.MM_returnValue"/>
    It is the onClick that it is having problems with. Any ideas how I can fix this?

    Cheers

    James

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Change it to onclick (no upercase C) though there may be a better way.

  3. #3
    SitePoint Addict Jamieharrop's Avatar
    Join Date
    Mar 2005
    Location
    West Yorkshire, UK
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looking at that, it is the uppercase "C" in "Click" which it doesn't like. Remember that everything should be lowercase in XHTML. Try changing the text to "onclick".

    Edit: Seems Ben beat me to it. Good call.
    Regards,
    Jamie Harrop

  4. #4
    SitePoint Guru redhillccwebmas's Avatar
    Join Date
    Jun 2005
    Posts
    989
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys for all your help

  5. #5
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When you become more experienced, you should look into unobtrusive JavaScript. That allows you to place the script code in an external file (good for caching) and remove the onclick attribute altogether (good for separating content from behaviour).
    Birnam wood is come to Dunsinane


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
  •