CSS for forms causing Submit to fail?

Not even sure I’m in the right forum.

http://stjudeschool.org/innerpage/static?staticpage_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

It’s not CSS, it’s the javascript validation i.e.

$("#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

OK, that makes sense, but when I remove the required=true, it still squaks. Why?

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=http%3A%2F%2Fstjudeschool.org%2Finnerpage%2Fstatic%3Fstaticpage_id%3D97&charset=(detect+automatically)&doctype=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?

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? :slight_smile:

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

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.

@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. :wink:

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

The doctype declaation should be at the very top of your file, with nothing before it. The <title> element goes within the <head> section:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
[COLOR="#FF0000"]<title>Title goes here</title>[/COLOR]
</head>
<body>


</body>
</html>

No probs :slight_smile:

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.