SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    Springfield, Missouri
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Serious problem with form

    I use LinkAlarm to check my site for broken links as I have a large animal shelter directory and checking them by hand is not possible.

    Now I'm getting a gazillion 404's on my broken link report mostly looking for http://muttcats.com/shelters/get which does not exist.

    Here is a link to my report. http://reports.linkalarm.com/8174969...nks.404.1.html

    I believe this must be caused by one of my forms but I don't even know which one or how to fix it. I fear that if this is causing trouble for the LinkAlarm bot then it is probably also causing trouble for Googlebot and others.

    It looks to me like it is most likely this form causing the problem since it is the only form that appears on all pages with errors:
    Code:
    <form style="text-align: center" action="get">
    <fieldset style="border: none"><input type="checkbox" name="targetnew"
    onclick="hyperlinks(this.checked)" value="ON" />
    Check Box to Open Links in New Window</fieldset>
    </form>
    It is driven by the following external .js:
    Code:
    //Open links in new window option- By spk100 (spk100@yahoo.com)
    //Script featured on Dynamic Drive
    //Visit http://www.dynamicdrive.com for this script and more
    function hyperlinks(target)
    {
    if (target) where = "_blank";
    else where = "_self";
    for (var i=0; i<=(document.links.length-1); i++)
    {
    document.links[i].target = where;
    }
    }
    How can I fix this mess?

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Your METHOD should be GET, not your action. Your action should go to the page with code to process user input from the form.

    Hope this helps

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    Springfield, Missouri
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I this particular case, The action line should be simply pointing to the external script, not another page.

    Would it cause a problem by doing that, since each page references the target script in the head tag?

  4. #4
    Forensic SEO Consultant Webnauts's Avatar
    Join Date
    Jun 2003
    Location
    European Union
    Posts
    1,488
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Allow me to add some points here, concerning the above code:

    1. HTML 4.01 and XHTML require the "legend" element in fieldsets. Use this element immediately after the "fieldset" start tag.

    2. The "input" tag does not have an "id" attribute which must be used to explicitly associate this control with a "label" element. When electronic forms are designed to be completed online, the form shall allow people using assistive technology to access the information, field elements, and functionality required for completion and submission of the form, including all directions and cues [Section 1194.22 (n)]. Information attached to controls via the "label" element can be very useful to users of talking browsers. Note that "id" and "for" values are case sensitive. Visit http://www.w3.org/TR/WCAG10-HTML-TECHS/#forms-labels for more information.

    3. While I have not seen the complete code of your page, I would suggest you to check this issue if missing:
    The "style" attribute has been used but a default style sheet language has not been defined (note that HTML Validator would not see this declaration if it is sent as an HTTP header by a web server). HTML 4.01 and XHTML require this for valid documents. For example, include this in the "head" section of your document to specify "text/css" as the default style sheet language: <meta http-equiv="Content-Style-Type" content="text/css">. See http://www.w3.org/TR/html4/present/s...#default-style If you are using HTML Validator's integrated editor, then you can add this from the Tags menu and/or from the Tag Inserter.

    Good luck!

  5. #5
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    Springfield, Missouri
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by aroach
    I this particular case, The action line should be simply pointing to the external script, not another page.

    Would it cause a problem by doing that, since each page references the target script in the head tag?
    That post was made by my roommate trying to help me figure this out and I don't even know what he is talking about.

    We did a global find and replace and replaced action="get" with method="get". Now I can't validate though because it says I'm missing a form action and I haven't a clue what to put there. I don't know the first thing about HTML forms. The form does seem to still work though at least in IE.

  6. #6
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    Springfield, Missouri
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your concern, Webnauts. You've pointed these problems out to me several times before. I understand accessibility is your passion and someday I hope to make my site more accessible but I'm just a hobbyist with a po-dunk site, not a trained web developer.

    I can't understand a thing at the W3C site. I'm going to have to get a For Dummies... book or something.

    Like I said I don't know a thing about html forms and can't understand anything I have read about them. I don't know what to put in this label or legend or how to implement them. The only reason the fieldset is there is that I could not validate without it. I don't even know if it's been used properly. I just stuck it there and suddenly I validated.

    This form is not crucial to using the site. It works fine without it.

  7. #7
    Forensic SEO Consultant Webnauts's Avatar
    Join Date
    Jun 2003
    Location
    European Union
    Posts
    1,488
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. In my previous message above, the points 1 and 3 have nothing to do wilth accessibility! And accessibility is not my passion. It is everyones duty, to stop discrimination against people with disabilities!

    By the way, before you buy books, you can have a look here:

    2. Tutorial to build forms (GREAT AND EASY): http://www.tashian.com/htmlguide/form-codes.html

    3. Reference to understanding forms:http://www.talltech.com/student/imos...html/forms.htm

    4. Reference for "Form Validation" is here: http://www.yourhtmlsource.com/javasc...alidation.html

    5. Reference for building forms with CSS:
    http://www.realworldstyle.com/forms.html

    6. Reference for building Usable forms:
    http://www.digital-web.com/features/...2003-05b.shtml

  8. #8
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    Springfield, Missouri
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Will this work:

    form action=""

    or should I put the path to the external .js in the quotes. It's already in the head. Should I remove it from the head?

    Or should I see if I can get someone to rewrite it for a few bucks at the Trading Post?


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
  •