Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to validate for xhtml

Status
Not open for further replies.

richey1

Technical User
Oct 5, 2004
184
GB
I've been trying to rewrite my code to validate within firefox. I've gone through loads of pages and done ok - replace @ with @amp; and close <BR> <HR> <input> as <input /> for example
I'm still getting some errors but can't see what its getting at now...............any help appreciated
thanks
isobel

warning: <input> isn't allowed in <table> elements
warning: missing <tr> (that highlights on table border='0')
warning: discarding unexpected <table>
warning: missing <td> (that highlights on <TR> after the table border='0' line)
warning: missing <td> (that highlights on </TR> after table border='0' line again)


Dim azPath, azID
azID = "1129"
azPath = " + azID

Dim arrLetters
arrLetters =

Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")

b = "</P>"

b = b & "<table summary=""Choose a letter to view the services"" cellSpacing=0 cellPadding=4 width=80%

class='atoz'>" & _
"<TBODY>"

For x = 0 to 25
If x = 0 or x = 13 then
b = b & "<tr>"
End If

b = b & "<td align=center valign=middle>" & _
"<a href='" & azPath & "&amp;id=" & _
arrLetters(x) & "' class='Business'>" & arrLetters(x) & "<span class=""invis"">-</span></a></td>"

If x = 12 or x = 25 then
b = b & "</tr>"
End If
Next

b = b & "</tbody></table>"

b = b & "<span class=""plaintext"">"

Alphaid = Request.QueryString("id")
If Alphaid="all" Then
sqlstmt="Select * From Table1_new ORDER BY Name Asc"
else
sqlstmt="Select * From Table1_new WHERE Name like '" & AlphaID & "%%' ORDER BY Name Asc"
end if
set rs=ObjCon.execute(sqlstmt)

if rs.eof then
b = b & "<font color='#FF0000'><CENTER><H2>No Records</H2></CENTER></font>"
else
do while not rs.eof

b = b & "<input type=""hidden"" name=""PageID"" value=""" & request("page") & """ />"
pagelink = "main.asp?page=1134&amp;atoz=" & request.querystring("ID") & "&amp;PID=" & PAGEID & "&amp;id="
b = b & "<table border='0' width='100%'>"
b = b & "<tr>"
b = b & "<td width='100%'><a href= " & pagelink & rs("ID") & ">" & rs("Name") & "</a></td>"
b = b & "</tr>"
b = b & "<tr>"
b = b & "<td width='100%'>" & rs("Section1_Matter") & "</td>"
b = b & "</tr>"
b = b & "<tr>"
b = b & "<td width='100%'>" & rs("Section1_Officer") & "</td>"
b = b & "</tr>"
b = b & "<tr>"
b = b & "</tr>"
b = b & "<tr>"
b = b & "<td width='75%'></td>"
b = b & "</tr>"

rs.movenext
loop
b = b & "</table>"
end if
b = b & "</span>"

objBODY = b
 
You'll find it much easier to track down validation errors if you do this:
[ul]
[li]Run your ASP program through the browser
[/li]
[li]Use "view source" to see the generated XHTML
[/li]
[li]Find the bugs that the validator identifies
[/li]
[li]Fix the relevant bit of asp to generate valid code[/li]
[/ul]
Just looking at the asp and doing the html generation in your head is likely to miss a lot (and it's too much like hard work).

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Also meant to say that in XHTML all tags should be lowercase.
So <P> is invalid whereas <p> is valid.

All attributes to tags should be enclosed in quotes too.

Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
This is impossible to interpret while it looks like this. Can't you give us the link to the validator validating your page. Seeing the errors and parsed source code will help us help you much easier. Looking at the code right now it is also impossible to tell what to fix, since we cannot see the doctype, so we don't know to which standards you're adhering. One thing I can notice is that you are wrapping a table in a span, which is illegal and you seem to be having input element outside a form, again illegal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top