Null værdi
Jeg bøvler med denne fejl:'document.customerform.action' er null eller ikke et objekt
og sådan her ser koden ud:
<!--#include file="functions_opendb.asp"-->
<%
action=request.form("action")
If action="getemailsubmit" Then
rs1.open "SELECT * FROM customers WHERE cust_email='" & request.form("getemail") & "'",conn
customerdatafound=False: If NOT rs1.EOF Then customerdatafound=True
rs1.close
If customerdatafound=True Then
rs1.open "SELECT * FROM customers WHERE cust_email='" & request.form("getemail") & "'",conn
cust_name = rs1("cust_name")
cust_street = rs1("cust_street")
cust_zip = rs1("cust_zip")
cust_city = rs1("cust_city")
cust_email = rs1("cust_email")
cust_phone = rs1("cust_phone")
cust_ship_name = rs1("cust_ship_name")
cust_ship_street = rs1("cust_ship_street")
cust_ship_zip = rs1("cust_ship_zip")
cust_ship_city = rs1("cust_ship_city")
customerid=rs1("id")
rs1.close
rs1.open "SELECT * FROM orders WHERE ordernumber='" & session("ordernumber") & "'",conn
rs1("customerid") = customerid
rs1.update
rs1.close
End if
If customerdatafound=False Then
cust_name = request.form("cust_name")
cust_street = request.form("cust_street")
cust_zip = request.form("cust_zip")
cust_city = request.form("cust_city")
cust_email = request.form("cust_email")
cust_phone = request.form("cust_phone")
cust_ship_name = request.form("cust_ship_name")
cust_ship_street = request.form("cust_ship_street")
cust_ship_zip = request.form("cust_ship_zip")
cust_ship_city = request.form("cust_ship_city")
msgstr="Den angivne E-mail blev ikke fundet i kundekartoteket."
End If
End If
If action="" Then
rs1.open "SELECT * FROM orders WHERE ordernumber='" & session("ordernumber") & "'",conn
customerdatafound=False: If rs1("customerid") <> 0 Then customerdatafound=True: customerid=rs1("customerid")
rs1.close
If customerdatafound=True Then
rs1.open "SELECT * FROM customers WHERE id=" & customerid,conn
cust_name = rs1("cust_name")
cust_street = rs1("cust_street")
cust_zip = rs1("cust_zip")
cust_city = rs1("cust_city")
cust_email = rs1("cust_email")
cust_phone = rs1("cust_phone")
cust_ship_name = rs1("cust_ship_name")
cust_ship_street = rs1("cust_ship_street")
cust_ship_zip = rs1("cust_ship_zip")
cust_ship_city = rs1("cust_ship_city")
rs1.close
End if
End If
If action="customerdatasubmit" Then
errstr=""
If request.form("cust_name")="" Then errstr=errstr & "Du mangler at udfylde feltet ""Navn"".<BR><BR>"
If request.form("cust_street")="" Then errstr=errstr & "Du mangler at udfylde feltet ""Adresse"".<BR><BR>"
If request.form("cust_zip")="" Then errstr=errstr & "Du mangler at udfylde feltet ""Postnummer"".<BR><BR>"
If request.form("cust_city")="" Then errstr=errstr & "Du mangler at udfylde feltet ""By"".<BR><BR>"
If request.form("cust_email")="" Then errstr=errstr & "Du mangler at udfylde feltet ""E-mail"".<BR><BR>"
If errstr<>"" Then errstr="<BR><font color='#FF0000'><B>De modtagene oplysninger kunne ikke gemmes.</B></font><BR><BR><BR>" & errstr
If errstr="" Then
rs1.open "SELECT * FROM customers WHERE cust_email='" & request.form("cust_email") & "'",conn
If rs1.EOF Then rs1.addnew
rs1("cust_name") = request.form("cust_name")
rs1("cust_street") = request.form("cust_street")
rs1("cust_zip") = request.form("cust_zip")
rs1("cust_city") = request.form("cust_city")
rs1("cust_email") = lcase(request.form("cust_email"))
rs1("cust_phone") = request.form("cust_phone")
rs1("cust_ship_name") = request.form("cust_ship_name")
rs1("cust_ship_street") = request.form("cust_ship_street")
rs1("cust_ship_zip") = request.form("cust_ship_zip")
rs1("cust_ship_city") = request.form("cust_ship_city")
rs1.update
customerid=rs1("id")
rs1.close
rs1.open "SELECT * FROM orders WHERE ordernumber='" & session("ordernumber") & "'",conn
rs1("customerid") = customerid
rs1.update
rs1.close
response.redirect "cart_buy_step2.asp"
End If
End If
%>
<script type="text/javascript">
function customerdatasubmit(){
document.customerform.action.value='customerdatasubmit';
document.customerform.submit();
}
function getemailsubmit(){
document.customerform.action.value='getemailsubmit';
document.customerform.submit();
}
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="da">
<title>.:: PAPILOT ::.</title>
<link rel="stylesheet" href="stylesheets/main2.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center">
<table width="766" >
<tr>
<td>
<img src="images/default_01.gif" width="152" height="97" alt=""></td>
<td width="614" height="97" colspan="2" align="left" valign="bottom">
<!-- Topmenu --><!--#include file="header01.asp"--></td>
</tr>
</table>
<!--#include file="middle02.asp" -->
<%
If errstr<>"" Then
%>
<center>
<BR><BR>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr><td width="100%" class="normal" height="100" align="center"><% =errstr %></td></tr>
</table>
<br><br>
<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="768" id="AutoNumber6" cellpadding="8">
<tr>
<td class="blackhover" align="center"><a href="cart_buy_step1.asp">
<img border="0" src="images/icon_back.gif" align="middle"> Tilbage</a></td>
</tr>
</table>
<br>
<br>
</center>
</div>
<%
Else
%>
<div align="center">
<center>
<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="768" id="AutoNumber5" cellpadding="0">
<tr>
<td width="33%" class="normal" align="center"> </td>
<td width="33%" class="normal" align="center"> </td>
<td width="34%" class="normal" align="center"> </td>
</tr>
<tr>
<td width="33%" class="normal" align="center" height="30" bgcolor="#A0CAEC" style="border-top: 1px solid #FFFFFF"><b>1. Kundeoplysninger</b></td>
<td width="33%" class="blackhover" align="center" height="30"><b>2. Betalings- og forsendelsesmåde</b></td>
<td width="34%" class="normal" align="center" height="30"><b>3. Godkend ordre</b></td>
</tr>
<tr>
<td width="33%" class="normal" align="center" bgcolor="#A0CAEC" style="border-bottom: 1px solid #000000"> </td>
<td width="33%" class="normal" align="center" bgcolor="#A0CAEC" style="border-top: 1px solid #FFFFFF; border-bottom: 1px solid #000000"> </td>
<td width="34%" class="normal" align="center" bgcolor="#A0CAEC" style="border-top: 1px solid #FFFFFF; border-bottom: 1px solid #000000"> </td>
</tr>
</table>
<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="768" id="AutoNumber6" cellpadding="8">
<tr>
<td width="100%">
<input type="hidden" name="action" value="">
<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber7" cellpadding="0">
<tr><td width="66%" valign="top">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber8">
<tr>
<td width="50%">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber9">
<tr><td width="50%" class="normal" valign="top"><b>Kundeoplysninger:</b><br><br><br>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber12">
<tr><td class="normal">Navn:*</td><td>
<input type="text" name="cust_name" size="30" class="normal" value="<% =cust_name %>"></td></tr>
<tr><td class="normal">Adresse:*</td>
<td>
<input type="text" name="cust_street" size="30" class="normal" value="<% =cust_street %>"></td>
</tr>
<tr>
<td class="normal">Postnummer:*</td>
<td>
<input type="text" name="cust_zip" size="10" class="normal" value="<% =cust_zip %>"></td>
</tr>
<tr>
<td class="normal">By:*</td>
<td>
<input type="text" name="cust_city" size="30" class="normal" value="<% =cust_city %>"></td>
</tr>
<tr>
<td class="normal">E-Mail:*</td>
<td>
<input type="text" name="cust_email" size="30" class="normal" value="<% =cust_email %>"></td>
</tr>
<tr>
<td class="normal">Telefon:</td>
<td>
<input type="text" name="cust_phone" size="15" class="normal" value="<% =cust_phone %>"></td>
</tr>
<tr>
<td class="normal"> </td>
<td class="normal"> </td>
</tr>
<tr>
<td class="normal" colspan="2">* Felter skal udfyldes</td>
</tr>
</table>
</td>
<td width="50%" class="normal" valign="top"><b>Leveringsadresse</b><br>
(Hvis forskellig fra fatureringsadresse)<br>
<br>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber11">
<tr>
<td class="normal">Navn:</td>
<td class="normal">
<input type="text" name="cust_ship_name" size="30" class="normal" value="<% =cust_ship_name %>"></td>
</tr>
<tr>
<td class="normal">Adresse:</td>
<td class="normal">
<input type="text" name="cust_ship_street" size="30" class="normal" value="<% =cust_ship_street %>"></td>
</tr>
<tr>
<td class="normal">Postnummer:</td>
<td class="normal">
<input type="text" name="cust_ship_zip" size="10" class="normal" value="<% =cust_ship_zip %>"></td>
</tr>
<tr>
<td class="normal">By:</td>
<td class="normal"><input type="text" name="cust_ship_city" size="30" class="normal" value="<% =cust_ship_city %>"></td>
</tr>
</table>
<br><br><br>
</td>
<td width="50%" class="normal" valign="top" bgcolor="#F4F4F4">
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber10" bgcolor="#F4F4F4">
<tr>
<td class="normal" align="center">
<b>Hent mine kundeoplysinger</b><br>
<br>
Indtast din E-mail: <br>
<input type="text" name="getemail" size="20" class="normal"><br>
<br>
<input type="button" value="Hent" onclick="getemailsubmit();" class="normal"> </td>
</tr>
<tr>
<td class="normal" align="center"><b><font color="#FF0000"><% =msgstr %></font></b></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-top:1px solid #FFFFFF; border-bottom: 1px solid #253671; border-collapse: collapse" bordercolor="#111111" width="768" bgcolor="#9FC9EC">
<tr><td width="100%" height="5"></td></tr>
</table>
<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="768" id="AutoNumber13" class="normal">
<tr>
<td class="normal"> </td>
<td class="normal"> </td>
</tr>
<tr>
<td width="50%" class="blackhover" align="left"><a href="cart.asp">
<img border="0" src="images/icon_back.gif" align="absmiddle"> Tilbage</a></td>
<td width="50%" class="blackhover" align="right"><a href="java script:customerdatasubmit();">Videre
<img border="0" src="images/icon_next.gif" align="absmiddle"></a></td>
</tr>
</table>
<br>
</p>
</center>
</div>
<%
End If
%>
</form>
</body>
</html>
<!--#include file="functions_closedb.asp"-->
