472,993 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,993 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 3229
"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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.