Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

WAI validation

Featured Replies

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 :)

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.

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="" />

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.

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

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.

  • Author

 

 

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?

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...

Why does the image need to be wrapped up with an input element? Why not just display it as an IMG?

  • 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 :)

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.