I toppen har jeg et javascript - function check() - men det
virker ikke...?
De felter som der checkes på skriver ved submit ned i en database
med javascriptet virker kun hvis jeg fjerner [ ] i feltnavnet men
så skrives der ikke i databasen...
- og efter at der klikkes OK til at jeg mangler at udfylde sendes
formularen alligevel...
HVA' GØR JEG NU ... LILLE DU!
<%@ Language=JScript%>
<!-- #INCLUDE VIRTUAL="/config/include/utils.runtime6.asp" -->
<!-- #INCLUDE VIRTUAL="/config/include/ado.runtime6.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type"
content="text/html;charset=ISO-8859-1">
<title>
www.b-seated.dk :: don't loose yout pants</title>
<link href="css/default.css" rel="stylesheet"
media="screen">
<style type="text/css" media="screen"><!--
#orderlayer { position: absolute; top: 106px;
left: 310px; width: 294px; height: 192px; visibility: hidden;
display: block }
--></style>
<% // GoLive Content Source
var products = ADORecordSet("b-seated" , "select * from
product01_belt", "block=1", "ID", "products");
%>
<csactions>
<csaction name="B9D5D9BA7" class="ShowHide"
type="onevent" val0="orderlayer" val1="1"></csaction>
<csaction name="B9D5DB869" class="Set Image URL"
type="onevent" val0="orderbutton" val1="images/order_set.gif"
urlparams="2"></csaction>
</csactions>
<csscriptdict import>
<script type="text/javascript"
src="GeneratedItems/CSScriptLib.js"></script>
</csscriptdict>
<csactiondict>
<script type="text/javascript"><!--
CSAct[/*CMP*/ 'B9D5D9BA7'] = new Array(CSShowHide,/*CMP*/
'orderlayer',1);
CSAct[/*CMP*/ 'B9D5DB869'] = new Array(CSSetImageURL,/*CMP*/
'orderbutton',/*URL*/ 'images/order_set.gif');
// --></script>
</csactiondict>
<csactiondict>
<script language="javascript">
function check()
{
if(document.FormOrder.navn[<%=products.AbsolutePosition%>].value=
="")
{
alert("Remember to fill in your name");
document.FormOrder.navn[<%=products.AbsolutePosition%>].focus();
return false;
}
else
if(document.FormOrder.adresse[<%=products.AbsolutePosition%>].val
ue=="" || isNaN(document.Add.Alder.value))
{
alert("Remember to fill in your age (must only contain a
number)");
document.FormOrder.adresse[<%=products.AbsolutePosition%>].focus(
);
return false;
}
else
{
return true;
}
}
</script>
</csactiondict>
</head>
<body bgcolor="#330000" leftmargin="0" marginheight="0"
marginwidth="0" topmargin="0">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<TABLE WIDTH=700 BORDER=0 CELLPADDING=0
CELLSPACING=0>
<TR>
<TD COLSPAN=3 ROWSPAN=2><IMG
SRC="images/layout_c_01.jpg" WIDTH=274 HEIGHT=163 ALT=""></TD>
<TD ROWSPAN=8><IMG
SRC="images/layout_c_02.jpg" WIDTH=13 HEIGHT=500 ALT=""></TD>
<TD COLSPAN=3><IMG
SRC="images/layout_c_03.jpg" WIDTH=413 HEIGHT=99 ALT=""></TD>
<TD><IMG SRC="images/spacer.gif"
WIDTH=1 HEIGHT=99 ALT=""></TD>
</TR>
<TR>
<TD COLSPAN=3 ROWSPAN=2><IMG
SRC="images/layout_c_04.jpg" WIDTH=413 HEIGHT=141 ALT=""></TD>
<TD><IMG SRC="images/spacer.gif"
WIDTH=1 HEIGHT=64 ALT=""></TD>
</TR>
<TR>
<TD COLSPAN=3 ROWSPAN=4><IMG
SRC="images/layout_c_05.jpg" WIDTH=274 HEIGHT=250 ALT=""></TD>
<TD><IMG SRC="images/spacer.gif"
WIDTH=1 HEIGHT=77 ALT=""></TD>
</TR>
<TR>
<TD COLSPAN=3><IMG
SRC="images/layout_c_06.jpg" WIDTH=413 HEIGHT=30 ALT=""></TD>
<TD><IMG SRC="images/spacer.gif"
WIDTH=1 HEIGHT=30 ALT=""></TD>
</TR>
<TR>
<TD ROWSPAN=4><IMG
SRC="images/layout_c_07.jpg" WIDTH=241 HEIGHT=230 ALT=""></TD>
<TD><a onclick="CSAction(new
Array(/*CMP*/'B9D5D9BA7',/*CMP*/'B9D5DB869'));return
CSClickReturn();" href="#" onfocus="if(this.blur)this.blur();"
csclick="B9D5D9BA7,B9D5DB869"><IMG SRC="images/layout_c_08.gif"
name="orderbutton" WIDTH=55 HEIGHT=47 ALT="" border="0"></a></TD>
<TD ROWSPAN=4><IMG
SRC="images/layout_c_09.jpg" WIDTH=117 HEIGHT=230 ALT=""></TD>
<TD><IMG SRC="images/spacer.gif"
WIDTH=1 HEIGHT=47 ALT=""></TD>
</TR>
<TR>
<TD ROWSPAN=3><IMG
SRC="images/layout_c_10.jpg" WIDTH=55 HEIGHT=183 ALT=""></TD>
<TD><IMG SRC="images/spacer.gif"
WIDTH=1 HEIGHT=96 ALT=""></TD>
</TR>
<TR>
<TD ROWSPAN=2><IMG
SRC="images/layout_c_11.jpg" WIDTH=29 HEIGHT=87 ALT=""></TD>
<TD WIDTH=119 HEIGHT=67
BGCOLOR=#441404>
<p class="spec">Belt made from
seatbelt and original lock from flightseat.<br>
4,8 x 110 cm <br>
Black / Silver</p>
</TD>
<TD ROWSPAN=2><IMG
SRC="images/layout_c_13.jpg" WIDTH=126 HEIGHT=87 ALT=""></TD>
<TD><IMG SRC="images/spacer.gif"
WIDTH=1 HEIGHT=67 ALT=""></TD>
</TR>
<TR>
<TD><IMG SRC="images/layout_c_14.jpg"
WIDTH=119 HEIGHT=20 ALT=""></TD>
<TD><IMG SRC="images/spacer.gif"
WIDTH=1 HEIGHT=20 ALT=""></TD>
</TR>
</TABLE>
</td>
</tr>
</table>
<div id="orderlayer">
<form name="FormOrder" onsubmit="return check()"
action='config/actions/ado.actions6.asp?<%=URLArgs()%>'
method="post" >
<table class="order" border="0" cellspacing="4"
cellpadding="0">
<tr>
<td width="50">Qty.</td>
<td></td>
<td><input class="orderfields"
type="text" name='antal[<%=products.AbsolutePosition%>]' value=''
size="3"></td>
</tr>
<tr>
<td width="50">Name</td>
<td></td>
<td><input class="orderfields"
type="text" name='navn[<%=products.AbsolutePosition%>]' value=''
size="35"></td>
</tr>
<tr>
<td width="50">Address</td>
<td></td>
<td><input class="orderfields"
type="text" name='adresse[<%=products.AbsolutePosition%>]'
value='' size="35"></td>
</tr>
<tr>
<td width="50">Postcode</td>
<td></td>
<td>
<table class="order" border="0"
cellspacing="0" cellpadding="0">
<tr>
<td><input
class="orderfields" type="text"
name='postnr[<%=products.AbsolutePosition%>]' value=''
size="5"></td>
<td width="10"></td>
<td>City</td>
<td width="10"></td>
<td><input
class="orderfields" type="text"
name='city[<%=products.AbsolutePosition%>]' value=''
size="20"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="50">E-mail</td>
<td></td>
<td><input class="orderfields"
type="text" name='email[<%=products.AbsolutePosition%>]' value=''
size="35"></td>
</tr>
<tr>
<td width="50"></td>
<td></td>
<td><input type="checkbox"
name='arkiv[<%=products.AbsolutePosition%>]' value="1"> Subscribe
to our newsletter</td>
</tr>
<tr>
<td width="50"></td>
<td></td>
<td><input class="orderbutton"
type="submit" name="$AddRecord" value="ORDER"
<%SetupADOAdd("order_ok.html", "$return", products)%>></td>
</tr>
</table>
<% SetupADOForm(products); %>
</form>
</div>
</body>
</html>
--
Vil du lære at kode HTML, XHTML, CSS, SSI eller ASP ???
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials