Kontrol af indtastet data ved formular - HJÆLP
Kære alleNu håber jeg, at jeg kan forklare mig godt nok...ellers må I endelig sige til ;-)
Jeg kan desværre kun en meget lille smule ASP, så jeg behøver jeres hjælp til dette - som jeg tror, ikke er så svært ;-)
På hjemmesiden www.vaugrenier.dk har vi en side, hvor på der er en formular.
Her er det muligt at udfylde formularen, som så sendes til administratoren.
I denne formular skal man udfylde navn og adresse med mere - men vi oplever en gang imellem, at folk glemmer at udfylde alle felterne !!
Jeg vil gerne have en pop-up warning, der advarer om, hvis man ikke har udfyldt alle felterne.
Det behøves ikke at være specificeret hvilke felter der ikke er udfyldt, blot en advarsel ala: "Alle stjernemarkerede fleter skal udfyldes".
Er der nogen der vil hjælpe med at indsætte lidt kode, således at man ikke kan fremsende formularen, uden at alle felter er udfyldt ???
Jeg går ud fra, at det er nedenstående fil der skal rettes ;-)
På forhånd tusind tak for hjælpen.
PS: Man kommer til formularsiden ved at følge denne sti: vaugrenier.dk -> Købe Lejlighed -> Her er formularen.... (nederst på siden)
Endnu engang tak - Jeg håber virkelig der er nogle eksperter der kan og vil hjælpe....
Med Venlig Hilsen
Peter
<%@ 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">
</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">
<table border="0" cellspacing="0" cellpadding="0">
<tr><td>Navn:</td><td><input type="text" name="strNavn" size="50"></td></tr>
<tr><td>Adresse: </td><td><input type="text" name="strAdresse" size="50"></td></tr>
<tr><td>Postnr: </td><td><input type="text" name="strPostnr" size="50"></td></tr>
<tr><td>By: </td><td><input type="text" name="strBy" size="50"></td></tr>
<tr><td>Land:</td><td><input type="text" name="strLand" size="50"></td></tr>
<tr><td>Telefon:</td><td><input type="text" name="strTelefon" size="50"></td></tr>
<tr><td>E-mail:</td><td><input type="text" name="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>