Hvad satan den åd halvdelen af mit script, nå men det er database genreret, så får du det lige i asp:
<HTML>
<HEAD>
<TITLE>:-)</TITLE>
<STYLE>
body { font-family: Tahoma; font-size: 13px; }
TD { font-family: Tahoma; font-size: 13px; }
input { width: 200px; }
textarea { width: 200px; }
input.knap { width: 100px; }
</STYLE>
<SCRIPT LANGUAGE=\"Javascript\">
function kundenr()
{
document.opretkunde.kundenummer.value = document.opretkunde.telefon.value;
}
postnr = new Array();
<%set rs = conn.execute(\"select * from postnr\")
do until rs.eof
response.write(\"postnr[\" & rs(\"postnr\") & \"] = \'\" & rs(\"city\") & \"\';\" & vbcrlf)
rs.movenext
loop
set rs = nothing
conn.close
set conn = nothing%>
function post()
{
if (eval(document.opretkunde.postnr.value) >= 1050 && eval(document.opretkunde.postnr.value) <= 9990)
document.opretkunde.city.value = postnr[eval(document.opretkunde.postnr.value)];
if (document.opretkunde.city.value == \'undefined\')
document.opretkunde.city.value = \'\';
}
</SCRIPT>
</HEAD>
<BODY ALINK=\"000000\" VLINK=\"000000\" LINK=\"000000\">
<!-- #include file=\"menu.txt\" --><BR><BR>
<B>Opret Kunde</B><BR><BR>
<FORM ACTION=\"opretkunde.asp?action=save\" METHOD=\"post\" NAME=\"opretkunde\">
<TABLE BORDER=\"0\">
<TR><TD>Kundenummer</TD><TD><INPUT TYPE=\"text\" NAME=\"kundenummer\"></TD></TR>
<TR><TD>Navn</TD><TD><INPUT TYPE=\"text\" NAME=\"navn\"></TD></TR>
<TR><TD VALIGN=\"top\">Adresse</TD><TD><TEXTAREA ROWS=\"3\" NAME=\"adresse\" cols=\"20\"></TEXTAREA></TD></TR>
<TR><TD>Postnr</TD><TD><INPUT TYPE=\"text\" NAME=\"postnr\" ONKEYUP=\"post();\" ONCHANGE=\"post();\"></TD></TR>
<TR><TD>By</TD><TD><INPUT TYPE=\"text\" NAME=\"city\" READONLY></TD></TR>
<TR><TD>Telefon</TD><TD><INPUT TYPE=\"text\" NAME=\"telefon\" ONKEYUP=\"kundenr();\" ONCHANGE=\"kundenr();\" MAXLENGTH=\"8\"></TD></TR>
<TR><TD>Telefax</TD><TD><INPUT TYPE=\"text\" NAME=\"telefax\"></TD></TR>
<TR><TD>Hjemmeside</TD><TD><INPUT TYPE=\"text\" NAME=\"hjemmeside\" VALUE=\"
http://\"></TD></TR><TR><TD>Email</TD><TD><INPUT TYPE=\"email\" NAME=\"email\"></TD></TR>
<TR><TD> </TD><TD ALIGN=\"right\"><INPUT TYPE=\"submit\" VALUE=\"Gem\" CLASS=\"knap\"></TD></TR>
</TABLE>
</FORM>
</BODY>
</HTML>