Just nu i M3-nätverket
Gå till innehåll

Tack sida i Firefox


roger_malmö

Rekommendera Poster

roger_malmö

Hej !

Har ett formmail.asp som inte vill fungera i Firefox men går bra i Explorer.

När jag i Firefox klickar på skicka knappen skall en tacksida dyka upp men istället får jag följande meddelande :Körningsfel i Microsoft VBScript fel '800a0009'

Felaktigt matrisindex: '[number: 1]'

/formmail.asp, rad 164

(På rad 164 är valideringen för email )

kanske behöver ni duktiga mer kött på benen ?

 

Hjälp mottages med tacksamhet.

Länk till kommentar
Dela på andra webbplatser

roger_malmö

Sorry, här kommer den

<%@ Language = vbscript%>
<%option explicit %>
<%server.scripttimeout = 600 %>
<%
'------------------------------------------- FORMMAIL V1.3 ------------------------------------------

'----------------------------------------------------------------------------------------------------
'copyright information
'----------------------------------------------------------------------------------------------------
'Copyright 2002: Sorted Sites [url="http://www.sortedsites.com/"]http://www.sortedsites.com[/url]
'Authors Jonas Tornqvist, David Parkes and Karl Snares
'This script is Freeware, which means you are free to use and modify 
'the script for your own use.
'The only condition is this copyright header remain intact and you don't 
'try and sell this script for profit without first asking us. 
'And of course also ask Matt Wright who wrote the original perl version of Formmail.

'----------------------------------------------------------------------------------------------------
'license agreement - Important
'----------------------------------------------------------------------------------------------------
'By using this script you agree to indeminfy the developers - Sorted Sites of any loss
'or damages that may arise from its use or missue.
'This script is provided as is with all faults - no warranties and no guarantees.
'basically its free - use it at your own risk and cost.
'No warranties and no tech support - if you need help with this don't ask us!
'The documentation is provided as is with all the help we can offer.
'As we develop this script we shall post updates hopefully fix any bugs
'We are not obliged to release any future versions and we might not bother...
'By using this script you accept this license agreement!

'----------------------------------------------------------------------------------------------------
'documentation v1.3
'----------------------------------------------------------------------------------------------------

'####################################################################################################
'this is where the code starts for real
'####################################################################################################

'----------------------------------------------------------------------------------------------------
'declare variables
'----------------------------------------------------------------------------------------------------
Dim strFrom, strTo, strSubject, strBody
Dim objMessage, objConfig, strServer, intPort
Dim recipient, redirect, subject, realname, email, required, strEmail1, strEmail2
Dim referer, url, url_verified, icounter, query, iloop, query2, query3, i, agree, validation, error0, error0ok

'############################## CONFIGURATION VARIABLES ####################################

'These are the only lines you will need to change
'----------------------------------------------------------------------------------------------------
strServer = "81.186.244.14" 'set which smtp server will be used to send the email. enter ip address or domain name. eg: "81.186.244.14" or "mail.xxxx.se"
intPort = 25 'set the smtp port to be used when sending mail (by default port 25 is used)
'Referrer's Array is defined here. Enter the valid domains which may use this script.
url = Array("www.jimson.se","jimson.se")'Set which urls that will be accepted. [url="http://xxxxx.se/"]http://xxxxx.se/[/url]
'Seperate multiple domains by commas 
'eg: url= Array("www.xxxxx.se","www.xxxx.se","www.xxx.se")
'computer names can be used instead of domains if this script is being run locally
'eg: url = Array("computername")

'######################################### IMPORTANT NOTICE #########################################
'IMPORTANT: do not modify anything below this line unless you know what you are doing!!
'######################################### IMPORTANT NOTICE #########################################

'----------------------------------------------------------------------------------------------------
'information type and CDOSYS constants
'----------------------------------------------------------------------------------------------------
%>
<!--METADATA TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library" -->
<!--METADATA TYPE="typelib"
UUID="00000205-0000-0010-8000-00AA006D2EA4"
NAME="ADODB Type Library" -->
<%
'----------------------------------------------------------------------------------------------------
'retrieved default fields
'----------------------------------------------------------------------------------------------------
recipient = request("recipient")
redirect = request("redirect")
subject = request("subject")
email = request("email")
required = request("required") 
if required = "" then
required = "recipient,subject,email,redirect"
else
required = "recipient,subject,email,redirect," & required
end if

'----------------------------------------------------------------------------------------------------
'verify the referer
'----------------------------------------------------------------------------------------------------
referer = request.ServerVariables("HTTP_REFERER") 
referer = split(referer,"/")
url_verified = "no"
for icounter = Lbound(url) to Ubound(url) '
if referer(2) = url(icounter) then
	 url_verified = "yes"
end if
next
if not url_verified = "yes" then 
response.write("The url specified is invalid!")
response.End
end if

'----------------------------------------------------------------------------------------------------
'verify the recipient(not tested)
'----------------------------------------------------------------------------------------------------
'trimed_referer = split(referer(2),".")'
'response.write recipient & "<br>" & referer(2) & "=" & trimed_referer(0) & "<br>"
'if trimed_referer(0) = "www" then
'	if InStr(1,recipient,trimed_referer(1),1) = 0 then
'		 response.write "recipient don't match the referer"
'		 response.end
'	end if
'else
'	if InStr(1,recipient,trimed_referer(0),1) = 0 then
'		 response.write "recipient don't match the referer"
'		 response.end
'	end if
'end if

'----------------------------------------------------------------------------------------------------
'retrieve form contents and create email fields
'---------------------------------------------------------------------------------------------------- 
query = Request.ServerVariables("QUERY_STRING") 
query = split(query,"&")
query3 = split(required,",")
For iLoop = Lbound(query) to UBound(query)
	query2 = split(query(iloop),"=")

'----------------------------------------------------------------------------------------------------
'form validation, checks required fields are not null
'----------------------------------------------------------------------------------------------------
	for i = LBound(query3) to UBound(query3)
		if query3(i) = query2(0) then
			if query2(1) = "" then
				response.write ("you must enter a valid ") & query2(0)
				response.end
			end if
		end if

		'if query2(0) = "agree" then
			'if query2(1) <> "on" or query2(1) = "" then
			'	response.write("You must agree to terms and conditions to enable Formmailv1.3 to execute!")
			 'response.end
			'end if
		'end if

'----------------------------------------------------------------------------------------------------
'form validation, checks a valid email address has been specified
'---------------------------------------------------------------------------------------------------- 		
		if query2(0) = "email" then
			 trim(query2(0))
			if len(query2(1))<8 then
 				response.Write("You must specify a valid ") & query2(0)
				response.end
			end if
			if instr(query2(1),"@")=0 and instr(query2(1),".")=0 then
				response.write query2(1)
				 response.Write("You must specify a valid ") & query2(0)
	 			response.end
			end if
			 strEmail1 = split(query2(1),"@")
			if len(strEmail1(1))<3 then
				response.Write("You must specify a valid ") & query2(0)
				 response.end
			end if
			strEmail2 = split(strEmail1(1),".")
			if len(strEmail2(0))<3 then
				response.Write("You must specify a valid ") & query2(0)
				response.end
			 end if
			if len(strEmail2(1))<2 then
		 		response.Write("You must specify a valid ") & query2(0)
				response.end
			end if
		 end if

'----------------------------------------------------------------------------------------------------
'form validation, checks terms and conditions checkbox has been ticked
'----------------------------------------------------------------------------------------------------

	Next
	if not query2(0) = "recipient" and not query2(0) = "redirect" and not query2(0) = "subject" and not query2(0) = "realname" and not query2(0) = "email" and not query2(0) = "required" and not query2(0) = "agree" then
		strBody = strBody & vbnewline & vbnewline & query2(0) &": " & query2(1) 
	end if
Next
if email = "" then
 email = "formmail@" & referer(2)
end if
'----------------------------------------------------------------------------------------------------
'replaces any special characters parsed through the query string
'----------------------------------------------------------------------------------------------------
strbody = replace(strbody, "+"," ")
strbody = replace(strbody, "%26%238364%3B","€")
strbody = replace(strbody, "%A1","¡")
strbody = replace(strbody, "%A3","£")
strbody = replace(strbody, "%A8","¨")
strbody = replace(strbody, "%AA","ª")
strbody = replace(strbody, "%AC","¬")
strbody = replace(strbody, "%B4","´")
strbody = replace(strbody, "%B7","·")
strbody = replace(strbody, "%BA","º")
strbody = replace(strbody, "%BF","¿")
strbody = replace(strbody, "%C7","Ç")
strbody = replace(strbody, "%E7","ç")
strbody = replace(strbody, "%0D%0A",vbnewline)
strbody = replace(strbody, "%21","!")
strbody = replace(strbody, "%22","¨")
strbody = replace(strbody, "%23","#")
strbody = replace(strbody, "%24","{:content:}quot;)
strbody = replace(strbody, "%25","%")
strbody = replace(strbody, "%26","&")
strbody = replace(strbody, "%27","'")
strbody = replace(strbody, "%28","(")
strbody = replace(strbody, "%29",")")
strbody = replace(strbody, "%2B","+")
strbody = replace(strbody, "%2C",",")
strbody = replace(strbody, "%2D","-")
strbody = replace(strbody, "%2E",".")
strbody = replace(strbody, "%2F","/")
strbody = replace(strbody, "%3A",":")
strbody = replace(strbody, "%3B",";")
strbody = replace(strbody, "%3C","<")
strbody = replace(strbody, "%3D","=")
strbody = replace(strbody, "%3E",">")
strbody = replace(strbody, "%3F","?")
strbody = replace(strbody, "%5B","[")
strbody = replace(strbody, "%5C","\")
strbody = replace(strbody, "%5D","]")
strbody = replace(strbody, "%5E","^")
strbody = replace(strbody, "%5F","_")
strbody = replace(strbody, "%60","`")
strbody = replace(strbody, "%7B","{")
strbody = replace(strbody, "%7C","|")
strbody = replace(strbody, "%7D","}")
strbody = replace(strbody, "%7E","~")
strbody = replace(strbody, "%F6","ö")
strbody = replace(strbody, "%D6","Ö")
strbody = replace(strbody, "%E5","å")
strbody = replace(strbody, "%C5","Å")
strbody = replace(strbody, "%E4","ä")
strbody = replace(strbody, "%C4","Ä")
strbody = replace(strbody, "%40","@")
'----------------------------------------------------------------------------------------------------
'this creates the body of the mail message, the text in quotes can be modified accordingly 
'---------------------------------------------------------------------------------------------------
strBody = "Här kommer det ett mail från hemsidan " & referer(2) & realname & strBody & vbnewline & vbnewline & "############# Slut på meddelandet #############" 

'----------------------------------------------------------------------------------------------------
'checks if a smtp port has been specified, if not it uses the default port 25
'----------------------------------------------------------------------------------------------------
if intport <> 25 then
intport = intport
else
 intport = 25
end if

'----------------------------------------------------------------------------------------------------
'send the mail message
'---------------------------------------------------------------------------------------------------- 
set objMessage = CreateObject("CDO.Message")
objMessage.To = recipient
objMessage.From = email
objMessage.Subject = subject
objMessage.Sender = email
objMessage.Textbody = strBody

'----------------------------------------------------------------------------------------------------
'cdosys configuration setup
'----------------------------------------------------------------------------------------------------
set objConfig = CreateObject("CDO.Configuration")
objConfig.Fields(cdoSendUsingMethod) = cdoSendUsingPort
objConfig.Fields(cdoSMTPServer) = strServer
objConfig.Fields(cdoSMTPServerPort) = intPort
objConfig.Fields(cdoSMTPAuthenticate) = cdoAnonymous
objConfig.Fields.Update
set objMessage.Configuration = objConfig

'----------------------------------------------------------------------------------------------------
'define error handling procedures
'----------------------------------------------------------------------------------------------------
On Error Resume Next
objMessage.Send
If Err.Number = 0 then
response.write("Formmail v1.3 processed all operations successfully!")
else
response.write("Formmail v1.3 detected the following errors:")& "<br>"
response.write("error no.: ")&err.number & "<br>"
response.write("description: ")&err.description & "<br>"
response.end
End If
On Error Goto 0

'----------------------------------------------------------------------------------------------------
'send them to the page specified
'----------------------------------------------------------------------------------------------------
Response.Redirect redirect

'####################################################################################################
'This is where the code ends
'####################################################################################################
%><!-- That's All Folks --><!-- Happy Surfing --><!-- Credits --><!-- David Parkes - Project Planning --><!-- Jonas Tornqvist - Lead Programmer version 1--><!-- Karl Snares - Lead Programmer version 1.2 & 1.3
<!-- Matt Wright - Original Formmail CGI Developer --> 

Länk till kommentar
Dela på andra webbplatser

oj, orkar inte titta igen deras generella kod (trodde det var din egen kod). Om du inte har ändrat något så beror problemen troligtvis att din formulärsida är helt hopplöst kodad. Taggar lite huller om buller, stilmallar som jag inte alls förstår hur du tänkt samt stor förvirring i tilldelning av name/id för dina imput-fält (vilket antagligen är problemet då du hade flera olika epostfält).

Testa en mer uppstädad/tillsnyggad variant:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>bestform</title>
<style type="text/css">
<!--
body {
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
font-size: 0.85em;
color: #FFF;
}

#Form1 {
width: 470px;
margin:auto;
}

#Form1 fieldset {
border:2px solid #CCC;
margin-bottom:15px;
padding:6px;
}

#Form1 legend {
font-size:90%;
font-weight:bold;
color: #FFF;
}

#Form1 label {
display:block;
float:left;
clear:none;
width: 50px;
}

#Form1 input {
width:150px;
}

#Form1 .numberField{
width:40px;
}

#Form1 .smallNumberField{
width:20px;
}

#Form1 .noWidth {
display:inline;
float:none;
width:auto;
}


-->
</style>
</head>
<body>
<form name="Form1" id="Form1" method="post" action="formmail.asp">
	<fieldset>
	<legend>Namn & Adress</legend>
	<p><label for="namn">Namn</label> <input type="text" name="namn" id="namn"><p>
	<p><label for="adress">Adress</label> <input type="text" name="adress" id="adress"></p>
	<p><label for="pnr">Post nr</label> <input type="text" name="pnr" id="pnr" size="8" class="numberField"></p>
	<p><label for="ort">Ort</label> <input type="text" name="ort" id="ort"></p>
	<p><label for="ort"></label></p>
	<p><label for="email">Epost</label> <input name="email" type="text" id="email"></p>
	</fieldset>
	<fieldset>
	<legend>Jag beställer</legend>
	<p>
	<input type="text" name="antalstaffanstorp" id="antalstaffanstorp" value="1" maxlength="3" class="smallNumberField">
	<label for="antalstaffanstorp" class="noWidth">ex av "Entreprenörererna skapade Staffanstorp" á 150kr</label>
	</p>
	<p>
	<input type="text" name="antalexkrydda" id="antalexkrydda" value="1" maxlength="3" class="smallNumberField">
	<label for="antalexkrydda" class="noWidth">ex av "Krydda med hjärtat 142 sätt att krydda brännvin" á 150kr</label>
	<P>
	<input type="checkbox" name="badabockernabestall" id="badabockernabestall" class="noWidth"> 
	<label for="badabockernabestall" class="noWidth">Jag beställer båda böckerna för 250:-</label>
	</p>
	</fieldset>
	<div style="text-align:center;">
	<input type="submit" id="submit" value="Skicka" class="noWidth">   
	<input type="reset" id="reset" value="Rensa" class="noWidth">
	<input type="hidden" name="subject" value="Bokbestallning">
	<input type="hidden" name="recipient" value="redaktionen@xxxxx.se">
	<input type="hidden" name="redirect" value="http://www.xxxxx.se/tack2.html">
	</div>
</form>
</body>
</html>

 

En stark rekommendation är att testa att validera koden lite då och då...

http://validator.w3.org/

http://jigsaw.w3.org/css-validator/

Länk till kommentar
Dela på andra webbplatser

roger_malmö

Tack för hjälpen Cluster, har gjort om formuläret, nu går det att skicka även i Firefox men när mailet kommer fram är de ifyllda fälten tomma.

<body>
<form id="form1" name="form1" method="post" action="formmail.asp">
<fieldset>
<legend class="stil1">Beställning<br />
</legend>
<p>
<input type="hidden" name="Adressuppgifter" id="Adressuppgifter" />
<span class="stil1">Adressuppgifter </span></p>
<label class="stil1">
<input type="text" name="namn" id="namn" />
Namn</label>
<br />
<br />
<span class="stil2">
<label class="stil1">
<input type="text" name="adress" id="adress" />
Adress</label>
</span> <br />
<br />
<label class="stil1">
<input type="text" name="postnummer" id="postnummer" />
Postnummer<br />
<br />
</label>
<span class="stil2">
<label class="stil1">
<input type="text" name="email" id="email" />
Mailadress</label>
</span> <br />
<input type="hidden" name="Bestaller Krydda med hjartat" id="Bestaller Krydda med hjartat" />
<span class="stil1">Beställer </span> <br />
<span class="stil1">
<input name="krydda med hjartat" type="checkbox" id="krydda med hjartat" />
<label for="krydda med hjartat">Krydda med hjärtat</label> 
a 150:-
</span><br />
<span class="stil1">
<input name="entreprenorer" type="checkbox" id="entreprenorer" />
<label for="entreprenorer">Entreprenörer byggde Staffanstorp</label>
a 150:- </span><br />
<span class="stil1">
<input name="badabockerna" type="checkbox" id="badabockerna" />
<label for="badabockerna">Båda böckerna för 250:-</label>
</span><br />
<br />
<input type="submit" name="skicka" id="skicka" value="Skicka" />
<input type="reset" name="reset" id="reset" value="Reset" /><br /></td>
<input type="hidden" name="recipient" value="xxxxxxxxxx">
					<input type="hidden" name="redirect" value="http://xxxxxxxxx">
	 				<input type="hidden" name="subject" value="Bestallning">
<br />
<br />
</fieldset>

</form>
</body> 

Länk till kommentar
Dela på andra webbplatser

sendordermail.asp är skriptet som tar emot formulärdatat och skickar mailet. Ersätter alltså i ditt fall formmail.asp

Du måste ange dina e-postserverinställningar (myMailServer, myUsername och myPassword) samt avsändar- och mottagaradress (strMailSender, strMailRecipient) för mailet.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
'----------------------| INSTÄLLNINGAR |-----------------------------

' Anpassa dessa att motsvara din mailleverantör
myMailServer = "mail.mindoman.nu"
myUsername = "anvandarnamn"
myPassword = "losenord"
intServerPort = 25

' Namn på filen med formuläret
strGoToPage = "mailform3.asp"

' Avsändare av mailet (om besökaren inte anger sin e-postadress)
strMailSender = "annan.adress@dindomän.nu"

' Mailets ärende
strMailSubject = "Bokbeställning"

' E-Postadress till mottagaren av formuläret
strMailRecipient = "redaktionen@xxxxx.se"

' Obligatoriska formulärfält (namnen avgränsas med kommatecken)
strRequiredFields = "namn,adress,pnr,ort"

' Namn på filen med formuläret
strGoToPage = "orderform.asp"

' Till vilken sida skall besökaren skickas om allt går bra?
strGoToPageSuccess = "http://www.xxxxx.se/tack2.html"

'--------------------------------------------------------------------

IF Request.Form("action")<>"doSend" THEN
' BESÖKAREN KOM EJ FRÅN FORMULÄRET PÅ RÄTT SÄTT
' Skickar tillbaks till formulärsidan
strGoToPage = strGoToPage&"?sendmail=failed"
ELSE
' KOLLAR ATT ALLA FÄLT ÄR KORREKT IFYLLDA
allFieldsOk = True
haveMissingFields = False
FOR Each item IN Request.Form
	' Strunta i vissa standardformulärvärden
	IF lCase(item)<>"submit" AND lCase(item)<>"action" THEN
		' Kolla om obligatoriska fält är ifyllda
		'Response.Write item &" = "& Request.Form(item) &" ("&inStr(lCase(strRequiredFields),lCase(item))>0&")"
		IF inStr(lCase(strRequiredFields),lCase(item))>0 AND Trim(Request.Form(item))="" THEN
			allFieldsOk = False
			haveMissingFields = True
			strMissing = strMissing & item & ","
		END IF
		' Skapa en sträng med alla formulärfält och deras värden
		IF trim(request.form(item))<>"" THEN
			strFormFields = strFormFields & uCase(item) & ": " & Trim(Request.Form(item)) & vbCrLf
		END IF
	END IF
Next
IF haveMissingFields THEN
	strMissing = "&missing="&strMissing
	strMailError = strMailError & "missingFields,"
END IF
IF Right(strMissing,1)="," THEN strMissing=Left(strMissing, (len(strMissing)-1)) END IF

' Här skulle man kunna kolla att det är en korrekt formaterad e-postadress
IF 1=0 THEN
	allFieldsOk = False
	strMailError = strMailError & "faultyEmail,"
END IF

' Använder besökarens e-post som avsändare om den angivits, annars standardadress från ovan
IF Trim(Request.Form("email"))<>"" THEN
	strMailSender = Trim(Request.Form("email"))
END IF

IF NOT allFieldsOk THEN
	' FEL PÅ NÅGOT INMATAT 
	' Skicka tillbaks till formulärsidan med felmeddelande
	strMailError = "&error="&strMailError
	IF Right(strMailError,1)="," THEN strMailError=Left(strMailError, (len(strMailError)-1)) END IF
	strGoToPage = strGoToPage&"?sendmail=failed"&strMailError&strMissing
ELSE
	' SKAPA MAILETS INNEHÅLL
	strMailBody = ""&_
		"ANGIVNA FÄLT"&vbCrLf&_
		"=========================================="&vbCrLf&_
		strFormFields&_
		"=========================================="&vbCrLf

	' SKAPAR HTML-FORMATERAT INNEHÅLL
	strHTMLbody=Replace(strMailBody, vbCrLf, "<br>")
	strHTMLbody=Replace(strHTMLbody, " ", " ") 

	' SKAPAR MAILET MED INSTÄLLNINGAR OCH SKICKAR DET
	cdoAnonymous = 0
	cdoBasic = 1
	cdoNTLM = 2 
	cdoSendUsingPickup = 1
	cdoSendUsingPort = 2
	SET objMail = server.CreateObject("CDO.message")
	SET objConf = server.CreateObject("CDO.configuration")
	objMail.TextBody = strMailBody
	objMail.HTMLBody = strHTMLbody
	objMail.From = strMailSender
	objMail.Sender = strMailSender
	objMail.Subject = strMailSubject
	objMail.To = strMailRecipient
	objConf.Fields.item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
	objConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = myMailServer
	objConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = intServerPort
	objConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
	objConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = myUsername
	objConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = myPassword
	objMail.Configuration = objConf
	objMail.Configuration.fields.update
	On error resume next
	objMail.Send

	SET objMail=nothing
	SET objConf=nothing

	' LITEN FELHANTERING
	IF Err.Number <> 0 THEN
		strGoToPage = strGoToPage&"?sendmail=failed&error=unknown"
	ELSE
		strGoToPage = strGoToPageSuccess
	END IF

END IF
END IF

' SKICKAR ANVÄNDAREN VIDARE
' beroende av vad som hänt ovan
Response.Redirect(strGoToPage)
%>

 

orderform.asp är formulärsidan. Surfa till den och fyll i formuläret för att skicka mail.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>bestform</title>
<style type="text/css">
<!--
body {
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
font-size: 0.85em;
color: #FFF;
}

#orderForm {
width: 470px;
margin:auto;
}

#orderForm fieldset {
border:2px solid #CCC;
margin-bottom:15px;
padding:6px;
}

#orderForm legend {
font-size:90%;
font-weight:bold;
color: #FFF;
}

#orderForm label {
display:block;
float:left;
clear:none;
width: 50px;
}

#orderForm input {
width:150px;
}

#orderForm .numberField{
width:40px;
}

#orderForm .smallNumberField{
width:20px;
}

#orderForm .noWidth {
display:inline;
float:none;
width:auto;
}

.messageBox {
width:465px;
margin:auto;
margin-bottom:10px;
padding:2px;
border:2px solid;
}

.error {
border-color:#990000;
background-color:#FFE8E8;
color:#990000;
}

.heading {
text-align:center;
font-weight:bold;
}
-->
</style>
</head>
<body>
<%
' TA EMOT SVAR FRÅN MAILSKRIPTET
strMissing = Request.QueryString("missing")
strError = Request.QueryString("error")

' OM NÅGOT GICK FEL
IF Request("sendmail")="failed" THEN
Response.Write("<div class=""messageBox error"">")
Response.Write("<p class=""heading"">Ett fel uppstod!</p>")
IF strError="missingFields" THEN
	' Skriver ut vilka obligatoriska fält som saknas (beroende på svar från sendmail.asp)
	Response.Write("<p> Obligatoriska uppgigfter saknas.<br> Du måste ange:</p><ul>")
	IF inStr(strMissing,"namn")>0 THEN Response.Write("<li>Namn</li>")
	IF inStr(strMissing,"adress")>0 THEN Response.Write("<li>Adress</li>")
	IF inStr(strMissing,"pnr")>0 THEN Response.Write("<li>Postnummer</li>")
	IF inStr(strMissing,"ort")>0 THEN Response.Write("<li>Ort</li>")
	Response.Write("</ul>")
END IF
IF strError="unknown" THEN
	' Skriver ut att okänt fel uppstod
	Response.Write("<p class=""heading"">Anledning okänd, meddelandet kunde ej skickas.</p>")
END IF
Response.Write("</div>")
END IF
%>
<form name="orderForm" id="orderForm" method="post" action="sendordermail.asp">
	<fieldset>
	<legend>Namn & Adress</legend>
	<p><label for="namn">Namn</label> <input type="text" name="namn" id="namn"><p>
	<p><label for="adress">Adress</label> <input type="text" name="adress" id="adress"></p>
	<p><label for="pnr">Post nr</label> <input type="text" name="pnr" id="pnr" size="8" class="numberField"></p>
	<p><label for="ort">Ort</label> <input type="text" name="ort" id="ort"></p>
	<p><label for="ort"></label></p>
	<p><label for="email">Epost</label> <input name="email" type="text" id="email"></p>
	</fieldset>
	<fieldset>
	<legend>Jag beställer</legend>
	<p>
	<input type="text" name="antalstaffanstorp" id="antalstaffanstorp" value="1" maxlength="3" class="smallNumberField">
	<label for="antalstaffanstorp" class="noWidth">ex av "Entreprenörererna skapade Staffanstorp" á 150kr</label>
	</p>
	<p>
	<input type="text" name="antalexkrydda" id="antalexkrydda" value="1" maxlength="3" class="smallNumberField">
	<label for="antalexkrydda" class="noWidth">ex av "Krydda med hjärtat 142 sätt att krydda brännvin" á 150kr</label>
	<P>
	<input type="checkbox" name="badabockernabestall" id="badabockernabestall" class="noWidth"> 
	<label for="badabockernabestall" class="noWidth">Jag beställer båda böckerna för 250:-</label>
	</p>
	</fieldset>
	<div style="text-align:center;">
	<input type="submit" id="submit" value="Skicka" class="noWidth">   
	<input type="reset" id="reset" value="Rensa" class="noWidth">
	<input type="hidden" name="action" value="doSend">
	</div>
</form>
</body>
</html>

 

Bifogar även dessa två filer i en zip-fil som du bara kan packa upp och lägga på webbserver.218730.zip

Länk till kommentar
Dela på andra webbplatser

roger_malmö

TUSEN TACK !!!!

Hittar inte poäng funktionen tycker här har blivit väldigt rörigt

Länk till kommentar
Dela på andra webbplatser

Alltid kul att kunna hjälpa till :thumbsup:

 

Poäng ger du genom att klicka på plus-symbolen i inläggets nedre högra hörn: post-3164-126868800946_thumb.png

Länk till kommentar
Dela på andra webbplatser

roger_malmö

Hoppas på att du ser detta cluster. Om jag lägger till ett meddelandefält så fungerar inte tecknen åäö i returmailet, vad blir fel ? Kodningen på sidan i övrigt är 8859-2 . är det där felet ligger kanske ?

Länk till kommentar
Dela på andra webbplatser

Hoppas på att du ser detta cluster. Om jag lägger till ett meddelandefält så fungerar inte tecknen åäö i returmailet, vad blir fel ? Kodningen på sidan i övrigt är 8859-2 . är det där felet ligger kanske ?

Antagligen så har du inte sparat filerna som UTF-8.

Öppna i Notepad och välj Spara som och kontrollera att formatet är UTF8 och inte ANSI.

Länk till kommentar
Dela på andra webbplatser

roger_malmö

Jo asp filerna är UTF 8 medan resten av sidorna på sajten är 8859-2 om det spelar roll

Länk till kommentar
Dela på andra webbplatser

Arkiverat

Det här ämnet är nu arkiverat och är stängt för ytterligare svar.

×
×
  • Skapa nytt...