Help - How can I validate ASP code for XHTML, || NAME vs ID attribute

S

Simon Barnett

Hi,

RE: Converting pages including ASP pages for XHTML

My question relates to ASP not ASP.NET - I can't find a newsgroup for ASP
and hoped it was still relevant in ASP.NET - sorry if it's not.

Problem: I am teaching myself about validating for XHTML and, upon testing a
page I get errors for the use of the 'name' attribute in form fields. It
seems that you have to replace the 'name' attribute for the 'id' attribute.
Of course when trying to retrieve the form values in the next page, they
have not been passed because of the lack of 'name' attribute.

So my question is: How can I validate this page for XHTML and still pass the
values to the receiving page?

Many thanks
Simon
 
B

Bruce Barker

xhtml still allows the name attribute for form and form elements. the
difference is that the name value, as id must be a valid identifier. (start
with a letter and allow only letters, numbers, underscore, colon, hyphen and
period as valid characters - note: asp.net breaks this rule).

here is a valid xhtml sample:

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<body>
<form name="form1">
<input type="submit" value="submit" name="submit" />
</form>
</body>
</html>


-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top