January 21, 200818 yr ok i am trying to make a form validate WAI. I have never done this but feel i need to learn. here is my code: <div id="login"> <h5>Login Here</h5> <form action="https://secure.registearpi.com/account/login.php?2382343=0000" method="post"> <fieldset> <p>User Name:</p> <input type="text" name="login" value="" /> <p>Password:</p> <input type="password" name="Password" value="" /> <input type="image" src="images/login.gif" value="login" /><br /> <input type="hidden" name="redir" value="/account/index.php" /> </fieldset> </form> <a href="/account/services/password/requestpassword.php"> Forgot password?</a> </div><!--END LOGIN--> The message i am getting when i try to validate is this: Rule: 1.1.2 - All INPUT elements are required to contain the alt attribute or use a LABEL. * Failure - INPUT Element, of Type TEXT, found at Line: 86, Column: 1 * Failure - INPUT Element, of Type PASSWORD, found at Line: 88, Column: 1 * Failure - INPUT Element, of Type IMAGE, found at Line: 89, Column: 1 I have googled but it seems this stuff is kinda hard to find so i thought i would ask all of you. also any other tips for getting sites to WAI validate would be great, i want to do this will all my sites from now on. thanks
January 21, 200818 yr Author i should add too im using doc type strict...so no name in the input field
January 21, 200818 yr ok i am trying to make a form validate WAI. I have never done this but feel i need to learn. here is my code: <div id="login"> <h5>Login Here</h5> <form action="https://secure.registearpi.com/account/login.php?2382343=0000" method="post"> <fieldset> <p>User Name:</p> <input type="text" name="login" value="" /> <p>Password:</p> <input type="password" name="Password" value="" /> <input type="image" src="images/login.gif" value="login" /><br /> <input type="hidden" name="redir" value="/account/index.php" /> </fieldset> </form> <a href="/account/services/password/requestpassword.php"> Forgot password?</a> </div><!--END LOGIN--> The message i am getting when i try to validate is this: Rule: 1.1.2 - All INPUT elements are required to contain the alt attribute or use a LABEL. * Failure - INPUT Element, of Type TEXT, found at Line: 86, Column: 1 * Failure - INPUT Element, of Type PASSWORD, found at Line: 88, Column: 1 * Failure - INPUT Element, of Type IMAGE, found at Line: 89, Column: 1 I have googled but it seems this stuff is kinda hard to find so i thought i would ask all of you. also any other tips for getting sites to WAI validate would be great, i want to do this will all my sites from now on. thanks Instead of using the <p>Password:</p> use labels: <label for="password">Password:</label> <br /> <input type="password" name="password" id="password" size="12" /> Do that for every input, if that brings somthing up message back.
January 21, 200818 yr Semantically you can't have an input element without a label. It's like having a newspaper with no headings, i.e.: meaningless. You should look to stucture your code as follows: <label>Username:</label> <input type="text" name="login" value="" />
January 21, 200818 yr Author But in xhtml strict you cant have name="NAME" can you? i mean the nae in an input or form.
January 21, 200818 yr Semantically you can't have an input element without a label. It's like having a newspaper with no headings, i.e.: meaningless. You should look to stucture your code as follows: <label>Username:</label> <input type="text" name="login" value="" /> lol true bout the newspapers... I prefer to use <label for="..."> the the user can click the label and the text box becomes active... just what i like tho.
January 21, 200818 yr But in xhtml strict you cant have name="NAME" can you? i mean the nae in an input or form. don't use name... use id instead
January 21, 200818 yr I prefer to use <label for="..."> the the user can click the label and the text box becomes active... Is that how you do it? I was wondering. Thanks for the tip.
January 21, 200818 yr here is an article from ALA: http://www.alistapart.com/articles/prettyaccessibleforms
January 21, 200818 yr Author here is an article from ALA: http://www.alistapart.com/articles/prettyaccessibleforms thanks for all the great help Now i have another question... what about the image for the button i.e., this part <input type="image" src="images/login.gif" value="login" /><br /> <input type="hidden" name="redir" value="/account/index.php" /> do i need to do any alt r anything like that? do they need labels, and ids?
January 21, 200818 yr thanks for all the great help Now i have another question... what about the image for the button i.e., this part <input type="image" src="images/login.gif" value="login" /><br /> <input type="hidden" name="redir" value="/account/index.php" /> do i need to do any alt r anything like that? do they need labels, and ids? urm.... im not too sure trial and error i guess, don't use name though, use id again... I have never used an image as the button so i don't exactly know. It won't need a label tho, dunno about an ALT tag though hmm try it and see...
January 21, 200818 yr Why does the image need to be wrapped up with an input element? Why not just display it as an IMG?
January 22, 200818 yr Author Why does the image need to be wrapped up with an input element? Why not just display it as an IMG? thats a good question...hmm i dont really know the answer. Forms are my weakest point in html, i have only done them a few times and dont really know much about them. I guess i need to read more and stuff, right now the submint or login button looks like this in my form. <input type="image" src="images/login.gif" value="login" /><br /> <input type="hidden" name="redir" value="/account/index.php" /> i know the first line is simply the image, right? the second line is a redirect to an account profile, dont you need the images to be an input for it to redirect? thanks guys im really glad i found this forum, i have never seen a forum where people were so nice and helpful
January 23, 200818 yr don't use name... use id instead If you're using php you'll need the name property. In which case you make your id and name property have the same value.
Create an account or sign in to comment