suserx
%Europe/Berlin %595 %2005, 15:17
Hallo allemaal,
Ik heb een mailform tutorial gedownload bij laiverd.com.
Het geheel werkt perfect wanneer ik het ofline test echter als ik het online zet krijg ik een undifined melding.
Ik snap niet waarom offline wel en online niet.
Ik hoop dat iemand hier mij verder op weg kan helpen.
De schrijver van de tutorial heeft aangeven dat hij waarschijnlijk vragen niet kan beantwoorden vanwege de drukte.
#include "string_fieldIsNotEmpty.as"
#include "string_stripSpaces.as"
#include "textfield_isEmail.as"
// INITIALISE THE FORM
// all fields
fieldArray = new Array(fullName_txt, email_txt, subject_txt, message_txt);
// fields that have to be filled
mustBeFilled = new Array(fullName_txt, email_txt);
// setting the initial text for the feedback textfield
feedback_txt.text = " ";
// defining colors for focused and non-focused fields
// change values as needed
focusColor = 0xD9D8A3;
nonFocusColor = 0xFFFFFF;
// some variables for error handling
errorColor = 0xF31035;
errorText = "<u><b>ERROR</b></u><br>Wilt u de velden <u>naam</u> en <u>email</u> alstublieft correct invullen.";
// make sure that fields change color on getting focus and loosing focus
for (tf = 0; tf < fieldArray.length; tf++) {
// setting the background color of the inputfields by defining a handler
// for the onSetfocus and onKillFocus events that are associated with
// each textfield
fieldArray[tf].onSetFocus = function() {
this.backgroundColor = focusColor;
};
fieldArray[tf].onKillFocus = function() {
this.backgroundColor = nonFocusColor;
};
}
// Setting some form and field properties
for (tf = 0; tf < fieldArray.length; tf++) {
// setting the bordercolor of the inputfields
fieldArray[tf].borderColor = 0xFFFFFF;
// make sure all fields are empty
fieldArray[tf].text = "";
// setting the tab order
fieldArray[tf].tabIndex = tf;
}
// Make sure that the first field gets the focus when we load the form
// where fieldArray[0] refers to the first element of the fieldArray array
Selection.setFocus(fieldArray[0]);
// Set scrollbar color; change values as needed
formStyle = new FStyleFormat();
formStyle.arrow = 0xFFFFFF;
formStyle.darkshadow = formStyle.highlight = formStyle.highlight3D = formStyle.shadow = 0xD4D000;
formStyle.face = 0xD4D000;
formStyle.scrollTrack = 0xFFFFFF;
formStyle.addListener(scroll_mc);
// Set the action for the submit button
submit_btn.onRelease = function() {
doFormCheck(mustBeFilled);
};
// Set the action for the clear button
clear_btn.onRelease = function() {
clearFields(fieldArray);
};
// Function to check the form
doFormCheck = function (whichArray) {
var numErrors = 0;
for (f = 0; f < whichArray.length; f++) {
thisField = String(whichArray[f]);
if (thisField.indexOf("email") != -1) {
whichArray[f].text = whichArray[f].text.stripSpaces();
whichArray[f].text = whichArray[f].text.toLowerCase();
if (!whichArray[f].isEmail()) {
whichArray[f].backgroundColor = errorColor;
numErrors++;
}
} else {
if (!whichArray[f].text.fieldIsNotEmpty()) {
whichArray[f].backgroundColor = errorColor;
numErrors++;
}
}
}
if (numErrors == 0) {
sendForm();
} else {
giveFeedback(errorText, 0);
}
};
// Function to actually send the form
sendForm = function () {
dataSender = new LoadVars();
dataSender.fullName = fullName;
dataSender.email = email;
dataSender.subject = subject;
dataSender.message = message;
dataReceiver = new LoadVars();
dataReceiver.onLoad = function() {
giveFeedback(dataReceiver.mailResult, 1);
};
dataSender.sendAndLoad("http://www.ssgi.nl/php/domail.php", dataReceiver, "GET");
};
// Feedback on sending/error status
function giveFeedback(feedbackMessage, clearField) {
feedback_txt.htmlText = feedbackMessage;
// clearfields on successful sent
if (clearField) {
clearFields(fieldArray);
}
}
// Function for clearing fields
clearFields = function (whichArray) {
for (i = 0; i < whichArray.length; i++) {
whichArray[i].text = "";
whichArray[i].backgroundColor = 0xFFFFFF;
}
};
Dit staat ik het domail.php bestand:
<?php
$destinationAdress="shai@ssgi.nl";
$nowDay=date("d.m.Y");
$nowTime=date("H:i:s");
$FormContent="Message date = $nowDay at $nowTime
From: $fullName
Email: $email
Subject: $subject
Message: $message
";
mail($destinationAdress, "$subject [ from $fullName ]", $FormContent, "From: $email");
$filename = "respond.txt";
$fd = fopen( $filename, "r" );
$start = "Beste ".$fullName."\n\n";
$contents = fread( $fd, filesize( $filename ) );
$mailContent = $start.$contents;
fclose( $fd );
mail( "$email", "Dit is een bevestiging", "$mailContent\n",
"From:shai@ssgi.nl\n" );
$mailResult="<u><b>SUCCESS</B></u><br>Uw bericht is verstuurd.";
echo "mailResult=$mailResult";
?>
Ik heb een mailform tutorial gedownload bij laiverd.com.
Het geheel werkt perfect wanneer ik het ofline test echter als ik het online zet krijg ik een undifined melding.
Ik snap niet waarom offline wel en online niet.
Ik hoop dat iemand hier mij verder op weg kan helpen.
De schrijver van de tutorial heeft aangeven dat hij waarschijnlijk vragen niet kan beantwoorden vanwege de drukte.
#include "string_fieldIsNotEmpty.as"
#include "string_stripSpaces.as"
#include "textfield_isEmail.as"
// INITIALISE THE FORM
// all fields
fieldArray = new Array(fullName_txt, email_txt, subject_txt, message_txt);
// fields that have to be filled
mustBeFilled = new Array(fullName_txt, email_txt);
// setting the initial text for the feedback textfield
feedback_txt.text = " ";
// defining colors for focused and non-focused fields
// change values as needed
focusColor = 0xD9D8A3;
nonFocusColor = 0xFFFFFF;
// some variables for error handling
errorColor = 0xF31035;
errorText = "<u><b>ERROR</b></u><br>Wilt u de velden <u>naam</u> en <u>email</u> alstublieft correct invullen.";
// make sure that fields change color on getting focus and loosing focus
for (tf = 0; tf < fieldArray.length; tf++) {
// setting the background color of the inputfields by defining a handler
// for the onSetfocus and onKillFocus events that are associated with
// each textfield
fieldArray[tf].onSetFocus = function() {
this.backgroundColor = focusColor;
};
fieldArray[tf].onKillFocus = function() {
this.backgroundColor = nonFocusColor;
};
}
// Setting some form and field properties
for (tf = 0; tf < fieldArray.length; tf++) {
// setting the bordercolor of the inputfields
fieldArray[tf].borderColor = 0xFFFFFF;
// make sure all fields are empty
fieldArray[tf].text = "";
// setting the tab order
fieldArray[tf].tabIndex = tf;
}
// Make sure that the first field gets the focus when we load the form
// where fieldArray[0] refers to the first element of the fieldArray array
Selection.setFocus(fieldArray[0]);
// Set scrollbar color; change values as needed
formStyle = new FStyleFormat();
formStyle.arrow = 0xFFFFFF;
formStyle.darkshadow = formStyle.highlight = formStyle.highlight3D = formStyle.shadow = 0xD4D000;
formStyle.face = 0xD4D000;
formStyle.scrollTrack = 0xFFFFFF;
formStyle.addListener(scroll_mc);
// Set the action for the submit button
submit_btn.onRelease = function() {
doFormCheck(mustBeFilled);
};
// Set the action for the clear button
clear_btn.onRelease = function() {
clearFields(fieldArray);
};
// Function to check the form
doFormCheck = function (whichArray) {
var numErrors = 0;
for (f = 0; f < whichArray.length; f++) {
thisField = String(whichArray[f]);
if (thisField.indexOf("email") != -1) {
whichArray[f].text = whichArray[f].text.stripSpaces();
whichArray[f].text = whichArray[f].text.toLowerCase();
if (!whichArray[f].isEmail()) {
whichArray[f].backgroundColor = errorColor;
numErrors++;
}
} else {
if (!whichArray[f].text.fieldIsNotEmpty()) {
whichArray[f].backgroundColor = errorColor;
numErrors++;
}
}
}
if (numErrors == 0) {
sendForm();
} else {
giveFeedback(errorText, 0);
}
};
// Function to actually send the form
sendForm = function () {
dataSender = new LoadVars();
dataSender.fullName = fullName;
dataSender.email = email;
dataSender.subject = subject;
dataSender.message = message;
dataReceiver = new LoadVars();
dataReceiver.onLoad = function() {
giveFeedback(dataReceiver.mailResult, 1);
};
dataSender.sendAndLoad("http://www.ssgi.nl/php/domail.php", dataReceiver, "GET");
};
// Feedback on sending/error status
function giveFeedback(feedbackMessage, clearField) {
feedback_txt.htmlText = feedbackMessage;
// clearfields on successful sent
if (clearField) {
clearFields(fieldArray);
}
}
// Function for clearing fields
clearFields = function (whichArray) {
for (i = 0; i < whichArray.length; i++) {
whichArray[i].text = "";
whichArray[i].backgroundColor = 0xFFFFFF;
}
};
Dit staat ik het domail.php bestand:
<?php
$destinationAdress="shai@ssgi.nl";
$nowDay=date("d.m.Y");
$nowTime=date("H:i:s");
$FormContent="Message date = $nowDay at $nowTime
From: $fullName
Email: $email
Subject: $subject
Message: $message
";
mail($destinationAdress, "$subject [ from $fullName ]", $FormContent, "From: $email");
$filename = "respond.txt";
$fd = fopen( $filename, "r" );
$start = "Beste ".$fullName."\n\n";
$contents = fread( $fd, filesize( $filename ) );
$mailContent = $start.$contents;
fclose( $fd );
mail( "$email", "Dit is een bevestiging", "$mailContent\n",
"From:shai@ssgi.nl\n" );
$mailResult="<u><b>SUCCESS</B></u><br>Uw bericht is verstuurd.";
echo "mailResult=$mailResult";
?>