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

  • Thread starter Thread starter Simon Barnett
  • Start date Start date
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
 
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)
 
Back
Top