468,733 Members | 2,278 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,733 developers. It's quick & easy.

form </input> validation

I have several input fields on my form, and the form works; however, Visual
Studio is showing errors, and I would like to get rid of them.

When the form is submitted, it is redirected back to itself, where it checks
the values that were entered.

If the default values are set, this is the visitor's first time to access
the page.

Example: The FirstName field would initially be displayed with "First Name;"
but, this value would not be valid for submitting the form.

If non-default values are available, they are validated before being
collected (i.e. FirstName can not be blank).

If a page is not valid, a note is displayed next to the failed fields and
all fields are populated with their previous values.

Example:
<input type="text" name="FirstName"><%Request.Form("FirstName")%></input>
<span><%Response.Write(strFirstNameErr)%></span>

For my html header, I use this format:
<!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" >

Visual Studio is giving me this error for the </inputtags:

Validation (XHTML 1.0 Transitional): Element 'input' is an empty element and
cannot have a closing tag. Instead, it must end with />.

What is the best way to correct this?
Sep 13 '07 #1
2 3053
"jp2code" <poojo.com/mailwrote in message
news:uv**************@TK2MSFTNGP02.phx.gbl...
>
I have several input fields on my form, and the form works; however, Visual
Studio is showing errors, and I would like to get rid of them.
Add/Remove Programs -Remove Visual Studio
>
When the form is submitted, it is redirected back to itself, where it
checks the values that were entered.

If the default values are set, this is the visitor's first time to access
the page.

Example: The FirstName field would initially be displayed with "First
Name;" but, this value would not be valid for submitting the form.
A far better approach would be to check the value of the "submit" button.
If non-default values are available, they are validated before being
collected (i.e. FirstName can not be blank).

If a page is not valid, a note is displayed next to the failed fields and
all fields are populated with their previous values.

Example:
<input type="text" name="FirstName"><%Request.Form("FirstName")%></input>
<span><%Response.Write(strFirstNameErr)%></span>

For my html header, I use this format:
<!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" >

Visual Studio is giving me this error for the </inputtags:

Validation (XHTML 1.0 Transitional): Element 'input' is an empty element
and cannot have a closing tag. Instead, it must end with />.

What is the best way to correct this?
<input type="text" name="FirstName" value="<%=Request.Form("FirstName")%>"
/>

--
Bob Milutinovic
Cognicom - "Australia's Web Presence Specialists"
http://www.cognicom.net.au/
telephone (0417) 45-77-66
facsimile (02) 9824-2240
Sep 13 '07 #2
Gazing into my crystal ball I observed "jp2code" <poojo.com/mail>
writing in news:ek**************@TK2MSFTNGP06.phx.gbl:
Nice crystal ball, Adrienne!

As for specifying Transitional and XHTML, I'm just using something I
found on another's HTML page.

How would I code my HTML using DocType and HTML? Any suggestions? I
take them, you know! :)
http://www.w3.org/QA/2002/04/valid-dtd-list.html

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Sep 14 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by Stefan Richter | last post: by
16 posts views Thread by Hosh | last post: by
2 posts views Thread by daniel.boorn | last post: by
9 posts views Thread by julie.siebel | last post: by
14 posts views Thread by JNariss | last post: by
27 posts views Thread by Chris | last post: by
11 posts views Thread by Rik | last post: by
3 posts views Thread by arty | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.