Her er hele scriptet med dansk fejlmeddelelse ved manglende input:
<%@ LANGUAGE=VBSCRIPT%>
<%Option Explicit%>
<%
Response.Buffer = True
Response.Expires = 0
Response.ExpiresAbsolute = Date() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<html>
<head>
<title>FORSIDE</title>
<link href="../style.css" rel="STYLESHEET" TYPE="text/css">
<script type="text/javascript">
<!--
function MM_validateForm() { //v4.0
if (document.getElementById){
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' skal indeholde en gyldig e-mail adresse.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('Følgende fejl opstod:\n'+errors);
document.MM_returnValue = (errors == '');
} }
//-->
</script>
</head>
<body topmargin="20" leftmargin="20" marginheight="20" marginwidth="20">
<h1>Købe lejlighed</h1>
<table border="0" width="100%" cellspacing="1">
<tr><td>
<%
'Her starter ny 2 tabel
Response.Write "<TABLE border=0 cellPadding=0 cellSpacing=0 width='600'><TBODY><TR>"
Response.Write "<TD width=10></TD>"
Response.Write "<TD align=left vAlign=top>"
Response.Write "<TABLE border=0 cellPadding=3 cellSpacing=0 width='600'>"
Response.Write "<TBODY>"
Response.Write "<TR><TR>"
Response.Write "<TD background='../hca/billeder/sogning-left.gif' bgColor='#a6bbd6' height=25 width=4></TD>"
Response.Write "<TD background='../hca/billeder/sogning-right-top.gif' bgColor='#a6bbd6' height=25><b>Gensalgslister</b></TD>"
Response.Write "<TD background='../hca/billeder/sogning-right.gif' bgColor='#a6bbd6' height=25 width=4></TD></TR>"
Response.Write "<TR><TD bgColor=#000000 colSpan=3 height=1></TD></TR>"
Response.Write "<TR>"
Response.Write "<TD background='../hca/billeder/bg-boks-left.gif' width=4 bgcolor=white></TD>"
Response.Write "<TD align=left vAlign=top bgcolor=white>"
'Nedenstående linie (100%) gør at teksten fylder hele tabellen
Response.Write "<TABLE align=left border=0 cellPadding=2 cellSpacing=0 bgcolor=white width='100%'>"
Response.Write "<TBODY><TR>"
Response.Write "<TD height=10 bgcolor=white></TD></TR>"
Response.Write "<TR>"
sti = "../log/filupload-salg-dk"
ShowSub = sti & request("ShowSub")
ShowSubLink = request("ShowSub")
strPathInfo = ShowSub
strPhysicalPath = Server.MapPath(strPathInfo)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strPhysicalPath)
Set objFSO = Nothing
SiteName = request.servervariables("script_name")
strPhysicalPath = Server.MapPath(ShowSub)
If ShowSub > " " then
ShowSub = Replace(ShowSub, " ", "%20")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strPhysicalPath)
Set objFolderContents = objFolder.Files
For Each objFileItem in objFolderContents
ShowPic = Replace(objFileItem.Name, " ", "%20")
Response.write "<tr><td>"
Response.Write "<span class=""link""><a href=""../log/filupload-salg-dk/" & objFileItem.Name &""" target=""_blank""><img src=""../filupload/graphics/max.gif"" alt=""Åben i nyt vindue"" border=""0""></a> <a href=""../log/filupload-salg-dk/" & objFileItem.Name & """ target=""_top"">" & Left(objFileItem.Name, InStrRev(objFileItem.Name, ".")-1) & "</a></span>"
Next
Set objFSO = Nothing
End if
%>
<br><br>
<strong><img src="../filupload/graphics/max.gif" width="10" height="10"><span class="style2"> = åbner filen i et nyt vindue</span></strong>
<%
Response.Write "</TR>"
Response.Write "<TR>"
Response.Write "<TD height=10 bgcolor=white></TD></TR></TBODY></TABLE></TD>"
Response.Write "<TD background='../hca/billeder/bg-boks-right2.gif' width=4 bgcolor=white></TD></TR>"
Response.Write "<TR>"
Response.Write "<TD background='../hca/billeder/bg-boks-bottom-left.gif' height=4 width=4 bgcolor=white></TD>"
Response.Write "<TD background='../hca/billeder/bg-boks-bottom.gif' bgcolor=white></TD>"
Response.Write "<TD background='../hca/billeder/bg-boks-bottom-right2.gif' height=4 width=4 bgcolor=white></TD></TR></TBODY></TABLE></TD>"
Response.Write "<TD width=10></TD></TR></TBODY></TABLE>"
%>
<br>
<%
dim P_kat,P_sprog,strSQL
P_kat=Request.QueryString("kat")
P_sprog=Request.QueryString("sprog")
Dim objRec, DBforbindelse, sti, ShowSub, ShowSubLink, strPathInfo, strPhysicalPath, objFSO, objFolder, SiteName, objFolderContents, objFileItem, ShowPic
Set DBforbindelse = Server.Createobject("ADODB.Connection")
DBforbindelse.Open "Driver={Microsoft Access Driver (*.MDB)}; DBQ=D:\www2\vaugrenier\log\artikellys.mdb;UID=;PWD=;"
'DBforbindelse.Open "Driver={Microsoft Access Driver (*.MDB)}; DBQ=C:\Inetpub\wwwroot\vaugrenier\hca\db\artikellys.mdb;UID=;PWD=;"
strSQL = "SELECT * FROM artikel WHERE sprog="& P_sprog & " AND " & "kategori=" & P_kat & "ORDER BY id"
Set objRec = DBforbindelse.execute(strSQL)
Do While Not objRec.EOF
'Her starter ny tabel
'Response.Write "<center>"
Response.Write "<TABLE border=0 cellPadding=0 cellSpacing=0 width='600'><TBODY><TR>"
Response.Write "<TD width=10></TD>"
Response.Write "<TD align=left vAlign=top>"
'Response.Write "<TABLE border=0 cellPadding=3 cellSpacing=0 width=600>"
Response.Write "<TABLE border=0 cellPadding=3 cellSpacing=0 width='600'>"
Response.Write "<TBODY>"
Response.Write "<TR><TR>"
Response.Write "<TD background='../hca/billeder/sogning-left.gif' bgColor='#a6bbd6' height=25 width=4></TD>"
Response.Write "<TD background='../hca/billeder/sogning-right-top.gif' bgColor='#a6bbd6' height=25><b>" & objRec("overskrift") & "</b></TD>"
Response.Write "<TD background='../hca/billeder/sogning-right.gif' bgColor='#a6bbd6' height=25 width=4></TD></TR>"
Response.Write "<TR><TD bgColor=#000000 colSpan=3 height=1></TD></TR>"
Response.Write "<TR>"
Response.Write "<TD background='../hca/billeder/bg-boks-left.gif' width=4 bgcolor=white></TD>"
Response.Write "<TD align=left vAlign=top bgcolor=white>"
'Nedenstående linie (100%) gør at teksten fylder hele tabellen
Response.Write "<TABLE align=left border=0 cellPadding=2 cellSpacing=0 bgcolor=white width='100%'>"
Response.Write "<TBODY><TR>"
Response.Write "<TD height=10 bgcolor=white></TD></TR>"
Response.Write "<TR>"
Response.Write Replace(objRec("indhold"),Vbcrlf,"<BR>")
Response.Write "</TR>"
Response.Write "<TR>"
Response.Write "<TD height=10 bgcolor=white></TD></TR></TBODY></TABLE></TD>"
Response.Write "<TD background='../hca/billeder/bg-boks-right2.gif' width=4 bgcolor=white></TD></TR>"
Response.Write "<TR>"
Response.Write "<TD background='../hca/billeder/bg-boks-bottom-left.gif' height=4 width=4 bgcolor=white></TD>"
Response.Write "<TD background='../hca/billeder/bg-boks-bottom.gif' bgcolor=white></TD>"
Response.Write "<TD background='../hca/billeder/bg-boks-bottom-right2.gif' height=4 width=4 bgcolor=white></TD></TR></TBODY></TABLE></TD>"
Response.Write "<TD width=10></TD></TR></TBODY></TABLE>"
'Response.Write "</center>"
objRec.MoveNext
Response.Write "<br>"
Loop
objRec.Close
Set objRec = Nothing
%>
</td>
</tr>
</table>
<form action="sendmail.asp" onsubmit="MM_validateForm('strNavn','','R','strAdresse','','R','strPostnr','','R','strBy','','R','strLand','','R','strTelefon','','R','strEmail','','RisEmail');return document.MM_returnValue">
<table border="0" cellspacing="0" cellpadding="0">
<tr><td>Navn:</td><td><input name="strNavn" type="text" id="strNavn" size="50"></td></tr>
<tr><td>Adresse: </td><td><input name="strAdresse" type="text" id="strAdresse" size="50"></td></tr>
<tr><td>Postnr: </td><td><input name="strPostnr" type="text" id="strPostnr" size="50"></td></tr>
<tr><td>By: </td><td><input name="strBy" type="text" id="strBy" size="50"></td></tr>
<tr><td>Land:</td><td><input name="strLand" type="text" id="strLand" size="50"></td></tr>
<tr><td>Telefon:</td><td><input name="strTelefon" type="text" id="strTelefon" size="50"></td></tr>
<tr><td>E-mail:</td><td><input name="strEmail" type="text" id="strEmail" size="50"></td></tr>
<tr><td valign="top">Bemærkninger: </td><td><textarea cols="49" rows="10" name="strText"></textarea></td></tr>
<tr><td colspan="2"><br><br>Bekræftelse ønskes pr:</td></tr>
<tr><td><br>E-mail <input type="radio" name="strTyp" value="Email" checked style="border:none"></td></tr>
<tr><td>Alm. post <input type="radio" name="strTyp" value="Post" checked style="border:none"></td></tr>
<tr><td></td><td align="right"><input type="submit" value="Send"></td></tr>
</table><br>
</form>
</body>
</html>