473,396 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 3255
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
2
by: francisco lopez | last post by:
Yesterday I had a problem with a javascript to validate my form, but you helped my out yesterday and it works now perfectly!!! so thank you!!! the problem I have now is the following: I put...
16
by: Hosh | last post by:
I have a form on a webpage and want to use JavaScript validation for the form fields. I have searched the web for form validation scripts and have come up with scripts that only validate...
2
by: daniel.boorn | last post by:
Form validation using JavaScript has never been as easy and simple! We have developed a free generic form validation script that can validate any form with very little JavaScript required in form!...
9
by: julie.siebel | last post by:
Hello all! As embarrassing as it is to admit this, I've been designing db driven websites using javascript and vbscript for about 6-7 years now, and I am *horrible* at form validation. To be...
14
by: JNariss | last post by:
Hello, I am fairly new to asp and jscript and am now in the process of learning some form validation. I am taking one step at a time by validating each field and testing it before moving onto...
27
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
7
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
3
by: arty | last post by:
So basically i have a form with a action attribute set to another form, it is a survey spread among several pages and using php sessions, now im trying to validate the form with Javascript but it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.