SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Posts
    97
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    CSS for forms causing Submit to fail?

    Not even sure I'm in the right forum.

    http://stjudeschool.org/innerpage/st...aticpage_id=97

    When I input any family name and 600 in the 3rd prompt, the second $500 prompt fails with the message "Please Input $500/ Family with 1 student". The user should be allowed to skip that field, but the code is halting me.

    I'm ok if you tell me this is not a CSS error, I'll go hunt down a forms forum.

    Paul

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,269
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)
    It's not CSS, it's the javascript validation i.e.
    Code JavaScript:
    $("#ffo").validate({
             rules: {
                  financial_familyname: "required",
                  financial_familyone: "required",
    		financial_total: "required",								
              },
              messages: {
                  financial_familyname: "Please enter Family name <br/>",
                  financial_familyone: "Please Input $500/ Family with 1 student<br/>",
    		financial_total: "Please Input Total <br/>",					           
              },
              errorLabelContainer: "#jqueryerrors",            
              invalidHandler: function() {
                  $("#jqeryerrors").show();
              }
          });

    As the validation code is now, that field is required so it can't be skipped

    *thread moved to javascript jquery forum

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Posts
    97
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    OK, that makes sense, but when I remove the required=true, it still squaks. Why?

  4. #4
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,090
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    Hi there,

    This probably isn't what you wanted to hear, but the markup on the page you link to is broken.
    There are stray tags, missing tags, inline CSS, JavaScript all over the place.
    You can see what I mean by running it through the W3 Validator: http://validator.w3.org/check?uri=ht...Inline&group=0
    It produces 134 errors and 82 warnings.

    I would really advise you to address this issue.
    Do you have the ability to modify the HTML or is it output by some CMS over which you have no control?

  5. #5
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Posts
    97
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Wow. What a piece of cr_p. I inherited it from a 3rd party developer overseas. No. thank you...I definitely appreciate your pointing this out.

    Looks like I have a lot of work for myself, eh? :-)

    I have the html code within the content. I'll start fixing. Alas, I am not a javascript programmer.

  6. #6
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,090
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    No problem.
    I know it might sound weird, but I quite enjoy this sort of thing, so let me know if you need a hand with anything.

    Once you have the HTML knocked into shape, it shouldn't be at all hard to sort out the JS validation.

  7. #7
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,269
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)
    @swmagic ; kudos for having the right attitude. I've seen more than one thread here where the member does not want to fix the mark-up that the CSS and javascript are on top of. Kind of like saying "I want to fix my rickity house but not the crumbling foundation" or " I want my car to keep its great paint job but not remove the rust beneath it". Sometimes a quick "patch job" might seem like the way to go to some, but your willingness to do things right shows you are a Professional.

    @Pullo ; not so wierd unless that makes two of us.

  8. #8
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Posts
    97
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Why thank you Pullo, what a nice thing to say.

    OK, now that Christmas is behind me I'm able to spend some time on this.

    The first message I noticed was the DOCTYPE error. I have one:

    <title>Saint Jude School</title><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    But it comes up in red in Dreamweaver. Why is that? Is there something wrong with it?

    Paul

  9. #9
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,331
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    The doctype declaation should be at the very top of your file, with nothing before it. The <title> element goes within the <head> section:

    Code:
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <title>Title goes here</title>
    </head>
    <body>
    
    
    </body>
    </html>

  10. #10
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,090
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    Quote Originally Posted by swmagic View Post
    Why thank you Pullo, what a nice thing to say.
    No probs

    Quote Originally Posted by swmagic View Post
    But it comes up in red in Dreamweaver. Why is that? Is there something wrong with it?
    Just to be clear, you should be running your site through the W3Validator to catch the errors.
    Dreamweaver is ok as editors go, but doesn't do too much to help you write valid markup.


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
  •