Help me validate XHTML 1.0 Strict!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #1

    Help me validate XHTML 1.0 Strict!

    Hi all,

    I am working on my site (http://loweparkercorp.com/transportest.html) but it doesn't validate properly (http://validator.w3.org/check?uri=ht...D0.7,*;q%3D0.3)

    I don't know enough about forms and the errors it's talking about to make a fix. Can some of you more experienced folks take a look and let me know what you think?

    Thanks!
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Code:
    <!-- START ZEBRATRACKS FORM -->
    <form action="#" method="post" id="zebra">
    <table width="100%" cellspacing="2" cellpadding="2" border="0">
    <tr>
       <td><div class="field1">First Name:</div></td>
       <td><input type="text" 
       name="fname" size="20" maxlength="50" 
       style="font-family:verdana,arial; 
       font-size:11px; width:90px" /></td>
    </tr>
    <tr>
       <td><div class="field1">Last Name:</div></td>
       <td><input type="text" 
       name="lname" size="20" maxlength="50" 
       style="font-family:verdana,arial; 
       font-size:11px; width:90px" /></td>
    </tr>
    <tr>
    
       <td><div class="field1">Email:</div></td>
       <td><input type="text" name="email" 
       size="20" maxlength="50" 
       style="font-family:verdana,arial; 
       font-size:11px; width:90px" /></td>
    </tr>
    <tr>
       <td>&nbsp;</td>
       <td><input type="button" value="Submit" name="Submit" 
       onclick="zebraValidator(this.form);" 
       style="font-family:verdana,arial; 
       font-size:12px; width:65px" /><input 
       type="hidden" name="list_idno" value="5555610" /></td>
    </tr>
    </table>
    </form>
    <!-- END ZEBRATRACKS FORM -->
    Add style div.field1 {text-align:right;fon t-family:verdana, arial;font-size:12px} to existing style sheet or separately.

    And instead of referring form by name in JavaScript (if you are doing that), refer it by id or tagName.

    Comment

    • RedSon
      Recognized Expert Expert
      • Jan 2007
      • 4980

      #3
      What do you mean refer to it by ID or tagName instead of name. Do I have to change the form further to add IDs or tagNames?

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        So that fixed my html issues, but now my javascript is broken.

        How do i fix that?

        Comment

        • hsriat
          Recognized Expert Top Contributor
          • Jan 2008
          • 1653

          #5
          What is the problem with JavaScript? Can you explain a bit what you are trying to achieve?

          Don't worry about referring the form, you are not doing that anywhere in the JavaScript. So its OK.

          Comment

          • RedSon
            Recognized Expert Expert
            • Jan 2007
            • 4980

            #6
            I dont think it has the proper first name last name and email when it submits them to the newsletter list.

            Can you see the js?

            Comment

            • hsriat
              Recognized Expert Top Contributor
              • Jan 2008
              • 1653

              #7
              Code:
              function zebraValidator(f){
               var n, e, zebraW, s, t, lid;
               fn = f.fname.value;
               ln = f.lname.value;
               e = f.email.value;
               lid = f.list_idno.value;
               s = "http://app.simplycast.com/";
               s += "external_form_handler.asp";
               s += "?list_idno="+lid+"&fname="+fn+"&lname="+ln+"&email="+e;
               t = "scrollbars=no,screenX=10,left=10,screenY=5";
               t += ",top=5,width=260,height=140,resizable=no";
               zebraW = window.open(s,"zebraW",t);
               zebraW.focus();
               f.reset();
              }
              I don't see any sort of validation here, so how is it supposed to validate first name, last name and email?

              And just a little change:
              Change this:
              Code:
              <input type="button" value="Submit" name="Submit" onclick="zebraValidator(this.form);" style="font-family:verdana,arial;font-size:12px; width:65px" />
              To this:
              Code:
              <input type="button" value="Submit" name="Submit" style="font-family:verdana,arial;font-size:12px; width:65px" />
              And this:
              Code:
              <form action="#" method="post" id="zebra">
              To this:
              Code:
              <form action="#" method="post" id="zebra" onsubmit="zebraValidator(this);return false;">
              Then add some validation feature in the validator function.

              Comment

              Working...