Hej
Är det omöjligt att få en kod att validera om man använder diverse asp scripts, form knappar etc ?
Jag lyckas då tamejfan inte.. :(
11 svar · 557 visningar · startad av Jeppeweb
Hej
Är det omöjligt att få en kod att validera om man använder diverse asp scripts, form knappar etc ?
Jag lyckas då tamejfan inte.. :(
Det är bara att se till att HTML-koden är riktig, så validerar den. Det spelar ingen roll vad som körs på servern, det är resultatet som räknas.
Om du vill ha hjälp måste du visa den kod du inte får ordning på.
Failed validation, 17 errors
Error Line 39 column 11: there is no attribute "name".
<form name="form3" method="post" action="dologin.asp?action=login" onsubmit="ret
--------------
Error Line 40 column 46: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.
<div id="logincolumn">
<h2>Logga in</h2>
Användarnamn:
<form name="form3" method="post" action="dologin.asp?action=login" onsubmit="return checkForm(this)">
<input name="username" type="text" class="2" />
Lösenord:
<input name="password" type="password" class="2" />
<p></p>
------------------
Error Line 41 column 0: character data is not allowed here.
Ja.. etc. Alla fel jag får kommer ifrån den snutten ovan.
Ge oss URL så vi kan se sammanhang.
nope
Här är en del grejer som är fel:
Det finns en del ställen du angivit attributvärden utan citattecken.
I XHTML så måste man alltid skriva citattecken.
Sen finns det en del ställen där du inte har avslutat element på rätt sätt.
Exempelvis måste input-element avslutas med /> eftersom dom inte har någon sluttagg.
Sen kan man tydligen inte lägga en input direkt efter en form.
Du måste lägga input-elementet inuti något "container-element" som exempelvis en p-tagg:
Tack, ska se över det där
<form name="form3" method="post" action="dologin.asp?action=login" onsubmit="return checkForm(this)">
<input name="username" type="text" class="2" />
Lösenord:
<input name="password" type="password" class="2" />
<p></p> <%
Set rs2 = Connect.execute("Select varde From settings where id = '2'")
if rs2("varde") = "1" then
Response.Write "<input name=submit type=submit value='Logga in' class=Inputsubmit>"
else
Response.Write "<input name=submit type=submit value='Logga in' class=Inputsubmit disabled>"
end if
rs2.close
connect.close
%>
</form>
Men var då? Jag avslutar ju med /> och har citattecken.. ? :S
Nej, titta noggrant:
Response.Write "<input name=submit type=submit value='Logga in' class=Inputsubmit>"
Error Line 17 column 7: required attribute "type" not specified.
<script>The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.
Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.
✉
Warning Line 19 column 35: character "<" is the first character of a delimiter but occurred as data.
if(form3.username.value.length < 2){This message may appear in several cases:
You tried to include the "<" character in your page: you should escape it as "<"
You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&", which is always safe.
Another possibility is that you forgot to close quotes in a previous tag.
✉
Warning Line 23 column 35: character "<" is the first character of a delimiter but occurred as data.
if(form3.password.value.length < 5){✉
Error Line 53 column 11: there is no attribute "name".
<form name="form3" method="post" action="dologin.asp?action=login" onsubmit="retYou have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
✉
Error Line 54 column 46: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.
<input name="username" type="text" class="2" />The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.
One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
✉
Error Line 55 column 0: character data is not allowed here.
Lösenord:You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>) or forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes).
✉
Error Line 56 column 50: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.
<input name="password" type="password" class="2" />✉
Error Line 57 column 85: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.
...alue='Logga in' class='Inputsubmit' />
<%
Set rs2 = Connect.execute("Select varde From settings where id = '2'")
if rs2("varde") = "1" then
Response.Write "<input name='submit' type='submit' value='Logga in' class='Inputsubmit' />"
else
Response.Write "<input name='submit' type='submit' value='Logga in' class='Inputsubmit disabled' />"
end if
rs2.close
connect.close
%>
fel
Så, grejjade det.. tack för hjälpen