Kan nogen vise mig hvorledes jeg laver en beregning hvor resultatet først vises og såfremt det godkendes, legges ind i et formularfelt for derefter at indgå i en email som en del af indholdet? Det hele skulle gerne foregå på samme html-side.
(NB: jeg har ikke adgang til CGI bin). Jeg har en del av modulerne der skal indgå men ved ikke rigtigt hvordan jeg får det hele til at hænge sammen :-((
norske-mike
!- i headeren genereres et ordrenummer, således
<html>
<header>
<script language=\'javascript\'>
var nu = new Date();
var ordrenummer = nu.valueOf();
</script>
</header>
<body>
der vises billede af varerne og to inputfelt der hedder hhv antal_vare1 og antal_vare2
der vises en knap \'udregn pris\'; når man klikker på den vises sum_vare1 og sum_vare 2
hvor sum_vare1 = antal_vare1 * 450
og sum_vare1 = antal_vare1 * 680
total(sum_vare1 + sum_vare2) vises nu som \' I ALT DKR\' og total
klikker man nu på \'Gå til Kassen\' havner man lenger ned på samme side hvor der findes dette modul:
------------------------
!- KASSEN
<form action=\"
https://pay.freeway.dk/secure/capture.asp\" method=\"POST\">
<table>
<tr>
<td>Merchantnumber</td>
<td><input type=\"text\" name=\"MerchantNumber\" value=\"\" size=\"15\"></td>
</tr>
<tr>
!- her skal indlægges total i feltet Amount
<td>Beløb i kr.</td>
<td><input type=\"text\" name=\"Amount\" size=\"15\"></td>
</tr>
<tr>
<td>Valuta</td>
<td><input type=text name=\"Currency\" value=\"208\"></td>
</tr>
<tr>
<td>Kortnummer</td>
<td><input type=text name=\"CardNumber\" size=20></td>
</tr>
<tr>
<td>Udløbsdato (MM/ÅÅ)</td>
<td><input type=text name=\"ExpireMonth\" size=2 maxlength=2 value=\"\"> /
<input type=text name=\"ExpireYear\" size=2 maxlength=2 value=\"\"></td>
</tr>
<tr>
!- her genereres ovennævnte ordrenummer med flg sætning:
<script type=\"text/javascript\">
document.write(ordrenummer)
</script>
!- Dette ordrenummer skal nu lægges ind i feltet OrderNumber
<td valign=top>Ordrenummer</td>
<td><input type=text name=\"OrderNumber\" value=\"\" size=25>
<br> <br>
<input type=hidden name=\"AcceptURL\" value=\"
http://shop.freeway.dk/accept.asp\"><input type=hidden name=\"DeclineURL\" value=\"
http://shop.freeway.dk/decline.asp\"></td>
</tr>
</table>
</form>
!-=======================================================
! der genere nu en email således:
<html>
<!-- Created with the CoffeeCup HTML Editor -->
<!--
http://www.coffeecup.com -->
<!-- Brewed on 17-10-2001 20:02:54 -->
<head>
<title></title>
</head>
<body>
<!-- Start of E-Mail Form JavaScript-->
<!-- DESCRIPTION: This will send you an e-mail with whatever your visitor enters in the fields.
INSTRUCTIONS: Place this entire script where you want the form to show up on the page. You can change the values (Name, E-mail, Phone, etc.) Just be sure to change that fields value in the script. See where is says, \"document.ccform.name.value\", that is for the input field \"name\". BE SURE TO CHANGE THE E-MAIL ADDRESS BELOW. Currently it\'s at \'you@yourprovider.com\'.
FUNCTIONALITY: Works in both Netscape and IE. ONLY WORKS IF THE VISITOR HAS THEIR E-MAIL SET UP ON THEIR BROWSER.
-->
<SCRIPT LANGUAGE=JavaScript>
//Modified by CoffeeCup Software
//This code is Copyright (c) 1998 CoffeeCup Software
//All rights reserved. License is granted to a single user to
//reuse this code on a personal or business Web Site.
<!--
if (navigator.appVersion.lastIndexOf(\'Win\') != -1) {
dropline = \"\\r\\n\" } else { dropline = \"\\n\" }
function coffeemsg(form) {
document.ccform.Message.value = (
\' \' + dropline + dropline
+ \'-----CoffeeCup AutoMated E-Mail Form---START----- \' + dropline
+ dropline + dropline
+ \'Name : \' + document.ccform.name.value + dropline
+ \'Phone : \' + document.ccform.phone.value + dropline
+ \'Subject : \' + document.ccform.subject.value + dropline
+ \'E-mail : \' + document.ccform.email.value + dropline
+ \'Message: \' + document.ccform.message.value
+ dropline + dropline
+ \'-----CoffeeCup AutoMated E-Mail Form----END------ \' + dropline
+ dropline + \'E-Mail Form JavaScript by:\' + dropline
+ \'
http://www.coffeecup.com\' + dropline
+ dropline + dropline
+ \' FIELD VALUES: \' + dropline
+ \' \' + dropline
);
}
// -->
</SCRIPT>
<FORM name=\"ccform\" method=\"post\" action=\"mailto:you@yourprovider.com?subject=Message\"
enctype=\"text/plain\">
<INPUT type=hidden name=\"Message\">
<FONT FACE=\"VERDANA, ARIAL\"><B>Name:</B></FONT><P>
<INPUT type=\"text\" size=25 name=\"name\" onChange=\"coffeemsg()\">
<P>
<FONT FACE=\"VERDANA, ARIAL\"><B>Phone:</B><P>
<INPUT type=\"text\" size=25 name=\"phone\" onChange=\"coffeemsg()\">
<P>
<FONT FACE=\"VERDANA, ARIAL\"><B>Email:</B></FONT><P>
<INPUT type=\"text\" size=25 name=\"email\" onChange=\"coffeemsg()\">
<P>
<FONT FACE=\"VERDANA, ARIAL\"><B>Subject:</B></FONT><P>
<INPUT type=\"text\" size=25 name=\"subject\" onChange=\"coffeemsg()\">
<P>
<FONT FACE=\"VERDANA, ARIAL\"><B>Message:</B></FONT><P>
<TEXTAREA rows=5 cols=45 wrap=\"auto\" name=message onChange=\"coffeemsg()\"></TEXTAREA>
<P>
<CENTER>
<INPUT type=submit value=\"Send Message\" onClick=\"coffeemsg()\">
</CENTER>
</FORM>
<P>
<!-- End of E-Mail Form JavaScript-->
</body>
</html>
!-=======================================================
</body>
</html>