Hvis det kan hjælpe er her min originale side - omend rimelig lang:
<%@ Language=VBScript %>
<%
Dim DBCMD
Dim StrCreateNew
set DBCMD = Server.CreateObject("ADODB.Connection")
DBCMD.Open = "DSN=adhocitsql"
%>
<!-- #include file="global_header.asp" -->
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Ronnie T. Moore -->
<!-- Web Site: The JavaScript Source -->
<!-- Dynamic 'fix' by: Nannette Thacker -->
<!-- Web Site:
http://www.shiningstar.net -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!!
http://javascript.internet.com -->
<!-- Begin
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
countfield.value = maxlimit - field.value.length;
}
// End -->
<!-- Begin
function textCounter2(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
countfield.value = maxlimit - field.value.length;
}
// End -->
</script>
<meta http-equiv="Content-Language" content="da">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<LINK REL="STYLESHEET" TYPE="text/css" HREF="../scripts/style.css">
<title>Rapporter problem til Hotline</title>
</head>
<script language="VBScript">
function CheckForm()
msgTxt = ""
if document.theForm.Brugernavn.value = "" then
msgTxt = msgTxt & "Du skal skrive dine initialer." & vbCrLf
end if
if Len(document.theForm.Brugernavn.value) > 20 then
msgTxt = msgTxt & "Dit Initial er for langt. Det er typisk på 2 eller 3 bogstaver." & vbCrLf
End if
If document.theForm.Ansvarlig.value = "vælg" then
msgTxt = msgTxt & "Du skal vælge hvilken afdeling, der skal have opgaven" & vbCrLf
End If
If document.theForm.Kategori.value = "vælg" then
msgTxt = msgTxt & "Du skal vælge hvilken kategori, opgaven tilhører" & vbCrLf
End If
If document.theForm.Betegnelse.value = "" then
msgTxt = msgTxt & "Du skal skrive en kort beskrivelse af problemet." & vbCrLf
End If
If Len(document.theForm.Betegnelse.value) > 50 then
msgTxt = msgTxt & "Du har skrevet for meget i feltet Betegnelse. Du må max. skrive 50 bogstaver." & vbCrLf
End If
If document.theForm.Problem.value = "" then
msgTxt = msgTxt & "Du skal beskrive dit problem." & vbCrLf
End If
If Len(document.theForm.Problem.value) > 500 then
msgTxt = msgTxt & "Du har skrevet en for lang beskrivelse i feltet Problem." & vbCrLf
End If
if document.theForm.Deadline.value = "" then
msgTxt = msgTxt & "Du har ikke skrevet en dato." & vbCrLf
end If
if isDate(document.theForm.Deadline.value) = false then
msgTxt = msgTxt & "Du har ikke skrevet datoen korrekt. Det rigtige dato format er dd-mm-åååå." & vbCrLf
End If
if msgTxt <> "" then
msgBox msgTxt,0+16,"Fejlrapporteringen er ikke udfyldt korrekt"
else
document.theForm.submit
end if
end function
</script>
<body>
<table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="2" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td VALIGN="top" ALIGN="left" bgcolor="#808080">
<h2 style="margin: 0 3"><font color="#FFFFFF"><b> Registrer en opgave...</b></font></h2>
</td>
</tr>
<tr>
<td VALIGN="top" ALIGN="left">
<h4>Når du sidder fast og det hele bare er umuligt og selv din superbruger
ikke kan hjælpe dig, kan du her på din skærm registrere en opgave eller et
problem direkte til
edb-afdelingen.</h4>
<h4>Du kan også søge i <a href="Knowledgebase.asp"><u>knowledgedatabasen</u></a> om
der skulle være andre der har haft samme problem. Så kan du være heldig at
få løsningen på dit problem med det samme!</h4>
</td>
</tr>
<tr>
<td VALIGN="top" ALIGN="left">
<form name="theForm" method="POST" action="opgave.asp?action=new">
<table border="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="278">
<tr>
<td width="80" bgcolor="#C0C0C0" height="18">
<h4 style="margin-left: 5; margin-right: 0; margin-top:0; margin-bottom:0"><b>Dine Initialer:</b></h4>
</td>
<td bgcolor="#C0C0C0" height="18">
<h4 style="margin:0; "><font color="#FFFFFF">
<b>
<input type="text" name="Brugernavn" size="4" value="<%=Session("BrugerID")%>"></b></font><b>
Opgaven tilhører
<select name="Ansvarlig" size="1">
<option value="vælg">Vælg afdeling</option>
<option value="Hotline">Hotline</option>
<option value="HP-Hotline">HP-Hotline</option>
</select></b></h4>
</td>
</tr>
<tr>
<td width="80" bgcolor="#C0C0C0" height="23">
<h3 style="margin-left: 5; margin-top:0; margin-bottom:0"><b>Kategori:</b></h3>
</td>
<td align="left" bgcolor="#C0C0C0" height="23">
<p style="margin-top: 0; margin-bottom: 0">
<select name="Kategori" size="1">
<option value="vælg">vælg kategori</option>
<% Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Session("ConnectionString")
sql="SELECT Distinct Betegnelse From OpgaveKategori ORDER BY betegnelse"
set rs = conn.execute(sql) %>
<% Do While Not rs.EOF %>
<option value="<%=rs("Betegnelse")%>" "selected"><%=rs("Betegnelse")%></option>
<% rs.MoveNext
Loop
rs.Close
conn.close
%>
</select>
</td>
</tr>
<tr>
<td width="80" bgcolor="#C0C0C0" height="41">
<h4 style="margin-left: 5; margin-right: 0; margin-top:0; margin-bottom:0"><b>Kort problem beskrivelse:</b></h4>
</td>
<td align="left" bgcolor="#C0C0C0" valign="top" height="41">
<h4>( Max 50 tegn )<br>
<textarea name=Betegnelse wrap=physical cols=50 rows=1 onKeyDown="textCounter(this.form.Betegnelse,this.form.remLen,50);" onKeyUp="textCounter(this.form.Betegnelse,this.form.remLen,50);"></textarea>
<input readonly type=text name=remLen size=2 maxlength=3 value="50" style="border: 0px solid #000000; background-color: #C0C0C0; font-weight:bold">tegn tilbage</font>
</h4>
</td>
</td>
</tr>
<tr>
<td width="80" valign="top" bgcolor="#C0C0C0" height="128">
<h4 style="margin-left: 5; margin-right: 0; margin-top:0; margin-bottom:0"><b>Problem:</b></h4>
</td>
<td bgcolor="#C0C0C0" valign="top" height="128">
<h4 style="margin-top: 0">( Max 300 tegn )<br>
<textarea name=Problem wrap=physical cols=50 rows=5 onKeyDown="textCounter2(this.form.Problem,this.form.remLen2,300);" onKeyUp="textCounter2(this.form.Problem,this.form.remLen2,300);"></textarea>
<input readonly type=text name=remLen2 size=3 maxlength=3 value="300" style="font-weight: bold; border: 0px solid #000000; background-color: #C0C0C0">tegn
tilbage</h4>
</td>
</tr>
<tr>
<td width="80" bgcolor="#C0C0C0" height="22">
<h4 style="margin-left: 5; margin-right: 0; margin-top:0; margin-bottom:0"><b>Deadline:</b></h4>
</td>
<td bgcolor="#C0C0C0" height="22">
<h6 style="margin:0; "><font color="#FFFFFF">
<input type="text" name="Deadline" size="10" value="<% = date +14 %>"></font></h6>
</td>
</tr>
<tr>
<td width="80" bgcolor="#C0C0C0" height="22">
<h4 style="margin-left: 5; margin-right: 0; margin-top:0; margin-bottom:0"><b>Pritoritet</b></h4>
</td>
<td bgcolor="#C0C0C0" height="22">
<h3 style="margin-top: 0; margin-bottom: 0">
<font color="#FF0000">
<select size="1" name="Prioritet">
<option value="98">Skal prioriteres</option>
<option value="5">Meget lav</option>
<option value="4">Lav</option>
<option value="3">Mellem</option>
<option value="2">Høj</option>
<option value="1">Meget høj</option>
</select> </font><font color="#FFFFFF">
<span style="background-color: #FF0000"> NB! Husk at andre også har
brug for hjælp, så vær omhyggelig med din prioritering </span></font></h3>
</td>
</tr>
</table>
<h3 align="center"><br>
<input type="button" value="Opret" name="send" onClick="checkForm()">
<input type="reset" value="Nulstil" name="B2"></h3>
<p><!-- #include file="global_footer.asp" --></p>
</form>
<p style="margin-top: 0; margin-bottom: 0"> </td>
</tr>
</table>
<%if not IsEmpty(Request.Form) then %>
<%if Request.QueryString ("action") = "new" then
Registreret = date + time
Rekvirent = Trim(Request.Form("Brugernavn"))
Kategori = Request.Form("Kategori")
Betegnelse = Trim(Request.Form("betegnelse"))
Problem = Request.Form("problem")
Deadline = Request.Form("Deadline")
Ansvarlig = Request.Form("Ansvarlig")
Tidsestimat = "0"
Prioritet = Request.form("Prioritet")
Status = "EJ PÅBEGYNDT"
Afsluttet = "0"
Vist ="1"
Registrant = "Intranet"
Betegnelse = Replace(Betegnelse,"'","''")
problem = Replace(problem,"'","''")
strCreateNew="INSERT INTO Opgave (Registreret, Rekvirent, Kategori, Betegnelse, Problem, Deadline, Ansvarlig, Tidsestimat, Prioritet, Status, Afsluttet, Vist, Registrant) Values('"&Registreret&"','"&Rekvirent&"','"&Kategori&"','"&Betegnelse&"','"&Problem&"','"&Deadline&"','"&Ansvarlig&"','"&Tidsestimat&"','"&Prioritet&"','"&Status&"','"&Afsluttet&"','"&Vist&"','"&Registrant&"')"
DBCMD.Execute strCreateNew
Response.redirect("OpgaveModtaget.asp")
%>
<% DBCMD.Close
set DBCMD = nothing
end if
end if%>
</body>
</html>