467,911 Members | 1,491 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

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

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

Dec 23 '05 #1
  • viewed: 2258
Share:
1 Reply
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)

"Simon Barnett" <su**@simonbarnett.com> wrote in message
news:xZ*****************@fe3.news.blueyonder.co.uk ...
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

Dec 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

22 posts views Thread by Haines Brown | last post: by
6 posts views Thread by mike | last post: by
7 posts views Thread by mike | last post: by
9 posts views Thread by mike | last post: by
10 posts views Thread by ATeal75 | last post: by
14 posts views Thread by JNariss | last post: by
2 posts views Thread by embz | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.