Form Field Validation And ASP
Hello I have a simple Flash contact form with name,email, message, etc fields and would like ASP - not Flash - to validate the fields. So if a site visitor completes the form and presses 'submit' while having omitted the @ sign, for example, from his email address, then ASP would tell Flash to display something like 'Please complete the email address field'. I have some ASP (VB Script) which does this, but how do I pass it to Flash, and how would I get Flash to display it in a simple dynamic text box next to the form? And what happens if more than one field has been incorrectly completed? Many thanks for any help. _Postman
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 02-05-2008, 07:46 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Form Field Validation, Specially Email Field. Any Ideas?
Hi. I have a simple flash form designed for my website i have all things done but i am not getting the idea how to validate the "Email" field like you validate it in JavaScript for an "@" and a "." to be present in the finally submitted form. I need to do it in ActionScript as the other form validation is done in it as well. Please let me know if you can help. Thanks
Form Field Validation, Specially Email Field. Any
Hi. I have a simple flash form designed for my website i have all things done but i am not getting the idea how to validate the "Email" field like you validate it in JavaScript for an "@" and a "." to be present in the finally submitted form. I need to do it in ActionScript as the other form validation is done in it as well. Please let me know if you can help. Thanks
Form Field Validation Troubles
Can someone please tell me what is wrong with this code!
I have a simple mailto form in my movie. I am trying to validate 3 form fields. If there is information in all 3, it passes the info to my external php file. If one or more fields is empty I want it to go to my invalid frame and tell the user to fill the required fields, etc. What's happening is that it's not validating, even if no fields are filled out it passes the null information to my php doc and sends me an empty e-mail. Here is the AS that I have on the submit button for the form:
on (release){
if (name_field != "" && email_field != "" && phone_field != "")
{
loadVariablesNum("scripts/thanks.php", 0, "POST");
gotoAndPlay("valid");
}
else
{
gotoAndPlay("invalid");
}
}
It seems like this should work? Any ideas are greatly appreciated!
Flash 4 Form Validation For Email Field
I guess i can only hope there is still someone around knowing this or that on Flash 4 form fields validation.
I have this:
On (Release)
If (FirstName eq "")
Go to and Stop (2)
Else If (Email eq "")
Go to and Stop (3)
Else If (ToSubject eq "")
Go to and Stop (4)
Else If (Description eq "")
Go to and Stop (5)
Else If (ToComments eq "")
Go to and Stop (6)
Else
Load Variables ("12php/0MailPHP.php", 1, vars=POST)
Go to and Stop (7)
End If
End On
And of course, the problem is the email field.
as is it only checks if anything has been entered, which is not enough, it should check for the @ and the . at least - i just don't know how to do this with Flash 4, any hints are welcome really........
(i got rid of MX for reasons i am not even sure anymore, just always preferred to work with 4)
Input Field Validation
I am using Flash MX and I am designing a form.
How do I validate input values that the user may enter.
For example if the user inputs a letter in a Telephone number field?
Input Field Validation
Hi,
I want create an input text field can only input EVEN numbers and do nothing when input other characters.
What codes I've to put in the button?
Help please.
Chris
Input Field Validation
Hi,
I want create an input text field can only input EVEN numbers and do nothing when input other characters.
What codes I've to put in the button?
Help please.
Chris
Simple Text Field Validation
I am trying to create a simple text field validation to make sure a user types in a particular string before the movie will go on to the next action when the press the continue button.
What am I doing wrong here - my script does not advance to next_movie.swf nor does it play the invalid frame no matter what I type in TextField2:
on (release) {
if (TextField2="sample text") {
loadMovieNum ("next_movie.swf", 0);
} else {
gotoAndStop ("invalid");
}
}
I have tried the == operand and also an else if statement to no avail
Why Is This Text Field Validation Failing
The script below is supposed to validate that each field in a flash form contains data, if not the user is prompted to enter the relevant information, however the script always continues to the end even if check="notok". I put a breakpoint at the If(check == "ok") line and the prompts appear in the text fields OK, but the script will not wait for the user to complete the form.
on (release)
{
check = "ok";
//Now import the variables we
//need to send in this movie clip
if(Semail.text != "" and check == "ok")
{
sender_mail = Semail.text;
}
else
{
check = "notok";
focusManager.setFocus(Semail);
Semail.text = "Please input your email!";
}
if(Sname.text != "" and check == "ok")
{
sender_name = Sname.text;
}
else
{
check = "notok";
focusManager.setFocus(Sname);
Sname.text = "Please input your name!";
}
if(Ssubject.text != "" and check == "ok")
{
sender_subject = Ssubject.text;
}
else
{
check = "notok";
focusManager.setFocus(Ssubject);
Ssubject.text = "Please enter a subject!";
}
if(Smessage.text != "" and check == "ok")
{
sender_message = Smessage.text;
}
else
{
check = "notok";
focusManager.setFocus(Smessage);
Smessage.text = "Please enter a message!";
}
If(check == "ok")
{
//all the vars we just imported
//will be sent via POST method now
loadVariables("sendmail.php", this, "POST");
this.onData = function()
{
for (var a in this)
{
trace([a, this[a]]);
}
//ok, next frame
_root.nextFrame();
}
Sname = '';
Semail = '';
Smessage = '';
Ssubject = '';
}
}
Text Field Data Validation
I have placed two input text field and I am inserting some values dynamically through those fields. Now I need to validate those field as string with no special character and number..and another one should be valid by number only. Suggestion and Ideas please.
Help With Form Validation
I have an actionscript it looks like this ....below.
How can I check for if there is an "@" or not ?
on (press) {
validname = "0";
validcompany = "0";
validaddress = "0";
validcity = "0";
validstaate = "0";
validcountry = "0";
validemail = "0";
validcomments = "0";
if (Number(length(name))>=1) {
validname = "10";
} else {
message = "*";
}
if (Number(length(company))>=1) {
validname = "10";
} else {
message = "*";
}
if (Number(length(address))>=1) {
validname = "10";
} else {
message = "*";
}
if (Number(length(city))>=1) {
validname = "10";
} else {
message = "*";
}
if (Number(length(staate))>=1) {
validname = "10";
} else {
message = "*";
}
if (Number(length(country))>=1) {
validname = "10";
} else {
message = "*";
}
if (Number(length(email))>=1) {
validemail = "10";
} else {
mailmessage = "*";
}
if (Number(length(comments))>=1) {
validcomments = "10";
} else {
message = "*";
}
}
on (release) {
if (Number(validname) == 10
and Number(validecompany) == 10
and Number(valideaddress) == 10
and Number(validecity) == 10
and Number(validestaate) == 10
and Number(validecountry) == 10
and Number(validemail) == 10
and Number(validcomments) == 10) {
message = "All fields completed correctly";
loadVariablesNum ("http://www.mydomain.com/cgi-bin/ezformml.cgi", 0, "POST");
}
}
Thank you
Form Validation
Gotta a problem,
how can I validate a form that the user could't use strange chars in text fields ?
Is there any way to exclude chars like : ? # % & " ! etc...?
thx in advance
Pedro Garcia
Form Validation
I would just like to be able to make sure that the user fills in every field. It doesn't really need email address checking or any other fancy stuff.
This script is in a loop on the timeline and gets read every 10 frames(I am dynamically updating the order total with this loop),
if (first_name == "" or last_name == "" or address == "" or city == "" or state == "" or zip == "" or country == "" or email == "" or payop == "") {
validate==no;
} else {
validate==yes;
}
Then:
on (release) {
if (validate==no) {
allfields.gotoAndPlay(2);
}
if (validate==yes) {
gotoAnPlay("confirm", 1);
}
}
On the submit button.
When all those fields are filled in, the variable won't change to "yes".
Any help would be greatly appreciated )
Form Validation
I wish to add some sort of validation to a form, so that there are no unexpected characters in names and that email addresses contain @ and at least one .
Can I write a function or subroutine to do this? I have never used functions before and I am a little unsure how to do this. I have a few fields on the form so I guess this will save repeating code???
Help
Thanks
Form Validation
Im trying to integrate flash with javascript using the javascript kit in dreamweaver. So far I'm not having much luck. The movie containing the form is loaded into a main movie on level 3. Can this movie get to the javascript contained in the HTML file needed to validate the form?
Thanks
Brian
Form Validation
Any idea how to check if a user input field/variable called email contains the characters @ and .
?
Form Validation
I made a flash website that has a contact form on it. I was wondering if anyone knows how I could check the 'email' field to see if it is a valid email address (eg. me @here.com). I don't know the scripting so that it checks for 'something@something.something'. How do I define the something in actionscript?
Thanks in advance,
Felix.
Form Validation
I have created a Flash Form in Flash MX. The form has various fields: name, address, email, telephone, etc. that pass to an email after the user clicks on the Submit button. I want to do one of two things:
1. I want to add some code so that after the user adds the 9 number telphone number that it automatically formats to (504) 123-4455 or 504-333-3333. So it would be after the user tabbs or moves off of the telephone text field, the number would automatically format.
- OR -
2. Or I just want to add some validation code to my submit button to check that the user has entered the proper format, either (504) 123-4455 or 504-333-3333.
Thanks, any help would be appreciated, I am really just an intermediate newbie.
Form Validation
I searched and found a few items kinda like my problem but not quite.
Ok I have 4 form elements that will be sent to a PHP script to email. All of the form elements are contained in one movie clip "form_mc"
I have a button that is a movie clip to send that has this code in it.
What its supposed to do is, when you enter the items correctly it will go to a frame (33) and say its sent successfully (and send the info to the mailform.php page. if its not entered correctly it will go to frame (31) and tell you it didnt.
code:
//this just fades in text on the button when rollover
//it works fine.
on(rollOver)
{
setProperty (this.glowtext, _alpha, "100");
}
on(rollOut)
{
setProperty (this.glowtext, _alpha, "35");
}
//Here is where I have problems
on(release)
{
if (_root.form_mc.name_txt.text != "")
{
_root.gotoAndPlay(33);
}
else
{
_root.gotoAndPlay(31);
}
}
For now I am just trying to get *just one* form item to work. If I can get that to work then the rest will be easy. The form item is input text and the instance is properly named "name_txt."
What happens is when I go to submit it always goes to frame 33 regardless of whether or not the name_txt has anything in it.
I have tried a couple of tutorials but they all seemed to have pretty much the same idea as what I have.
Any help would be greatly appreciated.
EDIT: Added [ as ] tags - jbum
Form Validation
I've tried a million differnt things on this already.
I have a submit button that will send three items of text data. Each text field needs to be filled in so I want to clarify there is text in the field before sent.
Currently I am using:
on (release){
if (fname.length)
warning = "more";
}
fname is the variable of required info. warning is the dynamic text field that will let the user know they need to fill the info out. It is not working though. What am I missing?
Form Validation Help
I posted this once last week without a reply and tried again this week without a reply as well.
im using flash mx pro or flash 7.0.2
hopefully its just a case of not putting it in the right forum area.
follow this link for the details and help me solve this madness
http://www.flashkit.com/board/showth...hreadid=629228
[F8] Form Validation Help
I have a simple input form to send to email. The mailto method will work fine. But I'm having a problem getting the field validation to work. Just wondering if I could get some help.
ronhvb
Form Validation
Hi,
I have made a personal info form on a page of a site I am doing as a project. As I am nub in actionscript, I don't Know how to validate Phone number text input field that will only except numbers.
Can anyone help me please...I am running out of time for my project submission...
[F8] AS Form / Validation Help
Hi
I have a form in flash with Combo Boxes and Input texts (compontents).
Below is the relevant part of the script. The bit I'm having problems with is the validating number part. When you enter an invalid ID number the message displays in theReel.text INVALID ID, but it still goes through as successfull. I tried to correct this by adding in the || theRodreg.text == "INVALID ID" || part to the following if statement, but this doesn't work either. Does anyone have any ideas?
Thanks
Code:
sender.onRelease = function() {
alphaString = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var s:String = theReelreg.text;
if (s.length != 5 || Number(s.substring(0, 4))>5816 || Number(s.substring(0, 4))<1815 || alphaString.indexOf(s.substring(4))<0) {
theReelreg.text = "INVALID ID";
};
if (theDate.text == "" || theSname.text == "" || theReelreg.text == "INVALID ID" || theRodreg.text == "INVALID ID" ||theScountry.text == "" || theFname.text == "" || theLname.text == "" || theDateofbirth.text == "" || theStreet.text == "" || theHnumber.text == "" || theCounty.text == "" || thePostcode.text == "" || theCountry.text == "" || my_cb.text == "SELECT REEL" || my_cb2.text == "SELECT ROD" || my_cb4.text == "SELECT ONE") {
msgText.text = "REQUIRED FIELDS NOT COMPLETED";
};
if (theEmail.text.indexOf("@") == -1 || theEmail.text.indexOf(".") == -1) {
theEmail.text = "ENTER VALID EMAIL ADDRESS";
} else {
msgText.text = "";
senderLoad.theDate = theDate.text;
senderLoad.theReelreg = theReelreg.text;
senderLoad.theSname = theSname.text;
senderLoad.theScountry = theScountry.text;
senderLoad.theFname = theFname.text;
senderLoad.theLname = theLname.text;
senderLoad.theDateofbirth = theDateofbirth.text;
senderLoad.theEmail = theEmail.text;
senderLoad.theStreet = theStreet.text;
senderLoad.theHnumber = theHnumber.text;
senderLoad.theCity = theCity.text;
senderLoad.theCounty = theCounty.text;
senderLoad.thePostcode = thePostcode.text;
senderLoad.theCountry = theCountry.text;
senderLoad.theAdults = theAdults.text;
senderLoad.theChildren = theChildren.text;
senderLoad.theReel = my_cb.text;
senderLoad.theGender = my_cb3.text;
senderLoad.theMarital = my_cb4.text;
senderLoad.theEmployment = my_cb5.text;
senderLoad.theFishing = my_cb6.text;
senderLoad.theWhere = my_cb7.text;
senderLoad.theAssociation = my_cb8.text;
senderLoad.sendAndLoad("reel-reg.php",receiveLoad);
}
};
receiveLoad.onLoad = function() {
if (this.sentOk) {
gotoAndPlay("success");
}
};
[F8] Form Validation
I created a form with input text boxes and check boxes. Everything was fine until I added validation functions. It is like the validation function works, but then if you correct the error it still shows as an error and prevent to move on to the next page. If you fill the form right the first time, then its ok and you can move on...
if someone would see the problem in this code:
Code:
var textFields:Number = 0
var textError:String = "*"
function validateTextField() {
errors_txt.text = "";
if (name_txt.text.length < 2 || isNaN(name_txt.text) == false) {
errors_txt.text = ("Some Informations are Missing or Incorrect");
name_txt.text = textError + name_txt.text;
name_txt.setTextFormat(formatter);
}else{
name_txt.text = "" + name_txt.text;
} else {
textFields = 1;}
};
var checkBoxes:Number = 0;
function validateCheckBoxes () {
checkBoxError_txt.text = "";
if (terms_cb.selected) {
checkBoxes += 1;
} else {
checkBoxError_txt.text = "All Boxes Must be Checked to Continue"
}
if (how_cb.selected) {
checkBoxes += 1;
} else {
checkBoxError_txt.text = "All Boxes Must be Checked to Continue"
}
if (accurate_cb.selected) {
checkBoxes += 1;
} else {
checkBoxError_txt.text = "All Boxes Must be Checked to Continue"
}
};
function goToConfirmation () {
if (checkBoxes == 3 && textFields ==1) {
_root.grid_mc.gotoAndStop(26);
} else {
test_txt.text = "AHHHHHHHH";
}
}
function validateForm() {
//formatter.color = 0x412472;
validateTextField();
validateCheckBoxes();
goToConfirmation();
}
submit1_btn.onRelease = validateForm;
thanks in advance... I am desperate
Form Validation Help...
I'm creating a short submit form...I'm trying to validate the text fields.
Here is the error I am getting:
Quote:
ReferenceError: Error #1069: Property indexOf not found on flash.text.TextField and there is no default value.
at contact_fla::content_mc_1/sendActions()
I get that on this piece of code:
ActionScript Code:
...
else if(this.contactForm_mc.email_txt.length == "" ||
this.contactForm_mc.email_txt.indexOf("@") == -1 ||
this.contactForm_mc.email_txt.indexOf(".") == -1)
{
this.contactForm_mc.status_txt.text = "Please enter a valid email address."
}
...
I'm using yellowDart's thread here and he says it works perfectly...I don't see what I'm missing...
Form Validation
Can someone please tell me why this validation won't work in vers 5?
function Send() {
if (_root.firstname == '') {
loadMovie("fname-error.swf", 1);
stop();
} else if (_root.lastname == '') {
loadMovie("lname-error.swf", 1);
stop();
} else if (isNan(day_telephone)) {
loadMovie("phone-error.swf", 1);
stop();
} else if (_root.email == '' || _root.email.indexOf('.', 0) == -1 || _root.email.indexOf('@', 0) == -1) {
loadMovie("email-error.swf", 1);
stop();
} else if (_root.maxrent == '') {
loadMovie("rent-error.swf", 1);
stop();
} else if (_root.bedrooms == '') {
loadMovie("bedrooms-error.swf", 1);
stop();
} else if (_root.movedate == '') {
loadMovie("date-error.swf", 1);
stop();
} else if (_root.myVar<1) {
loadMovie("check-error.swf", 1);
stop();
} else {
getURL("http://www.xxxxxxxx.com/", "_parent", "POST");
}
}
Form Validation
I have a simple flash form, which has some required fields, ie. name, addy, etc.
What I want to do, is validate that the fields have been filled before they can hit the "next" button.
I've searched the forum, but found nothing, so I appologize if this has been asked before.
As you know, my AS understanding is intermediate at best, but I don't think this is beyond my capabilities.
thanks in advance, this will score big with the PM...
Rev
Form Validation
Hi guys, I've a problem, I've a form in flash, built with Input Text Fields, my Variables are:
Nombres
Apellidos
Empresa
Telefono
Email
Ciudad
Comentarios
and I want to validate all the fields before somebody submits the button, how I can do this?
thanks!
Form Validation...
hi (again), I finally found a tutorial on how to get a form with checkboxes to work--but, I'm trying to make it where all the feilds have to be filled out before you can submit it. I just don't know what to put in this area.
here is the code--the problem is down at the bottom---
mc=this;
tfA=["company", "contact", "address", "city", "state", "zip", "phone", "email", "addinfo"];
cbA=["individual", "group", "medicare", "prescription", "life", "annuities", "longterm"];
submit_btn.onPress=function(){
lv=new LoadVars();
for(var i=0;i<tfA.length;i++){
lv[tfA[i]]=mc[tfA[i]].text;
}
for(var j=0;j<cbA.length;j++){
lv[cbA[j]]=mc[cbA[j]].selected;
}
lv.sendAndLoad("email_request1.php",lv,"POST");
}
submit_btn.onRelease = function(){
//I just don't know what to put after the if statment, I tried just the instance
names-no luck.
if ( ""){
_root.gotoAndPlay("error");
} else {
_root.gotoAndPlay("correct");
}
}
any suggestions?
thanks,
hutch
AS Form / Validation Help
Hi
I have a form in flash with Combo Boxes and Input texts (compontents).
Below is the relevant part of the script. The bit I'm having problems with is the validating number part. When you enter an invalid ID number the message displays in theReel.text INVALID ID, but it still goes through as successfull. I tried to correct this by adding in the || theRodreg.text == "INVALID ID" || part to the following if statement, but this doesn't work either. Does anyone have any ideas?
Thanks
Code:
sender.onRelease = function() {
alphaString = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var s:String = theReelreg.text;
if (s.length != 5 || Number(s.substring(0, 4))>5816 || Number(s.substring(0, 4))<1815 || alphaString.indexOf(s.substring(4))<0) {
theReelreg.text = "INVALID ID";
};
if (theDate.text == "" || theSname.text == "" || theReelreg.text == "INVALID ID" || theRodreg.text == "INVALID ID" ||theScountry.text == "" || theFname.text == "" || theLname.text == "" || theDateofbirth.text == "" || theStreet.text == "" || theHnumber.text == "" || theCounty.text == "" || thePostcode.text == "" || theCountry.text == "" || my_cb.text == "SELECT REEL" || my_cb2.text == "SELECT ROD" || my_cb4.text == "SELECT ONE") {
msgText.text = "REQUIRED FIELDS NOT COMPLETED";
};
if (theEmail.text.indexOf("@") == -1 || theEmail.text.indexOf(".") == -1) {
theEmail.text = "ENTER VALID EMAIL ADDRESS";
} else {
msgText.text = "";
senderLoad.theDate = theDate.text;
senderLoad.theReelreg = theReelreg.text;
senderLoad.theSname = theSname.text;
senderLoad.theScountry = theScountry.text;
senderLoad.theFname = theFname.text;
senderLoad.theLname = theLname.text;
senderLoad.theDateofbirth = theDateofbirth.text;
senderLoad.theEmail = theEmail.text;
senderLoad.theStreet = theStreet.text;
senderLoad.theHnumber = theHnumber.text;
senderLoad.theCity = theCity.text;
senderLoad.theCounty = theCounty.text;
senderLoad.thePostcode = thePostcode.text;
senderLoad.theCountry = theCountry.text;
senderLoad.theAdults = theAdults.text;
senderLoad.theChildren = theChildren.text;
senderLoad.theReel = my_cb.text;
senderLoad.theGender = my_cb3.text;
senderLoad.theMarital = my_cb4.text;
senderLoad.theEmployment = my_cb5.text;
senderLoad.theFishing = my_cb6.text;
senderLoad.theWhere = my_cb7.text;
senderLoad.theAssociation = my_cb8.text;
senderLoad.sendAndLoad("reel-reg.php",receiveLoad);
}
};
receiveLoad.onLoad = function() {
if (this.sentOk) {
gotoAndPlay("success");
}
};
Form Validation
Hi there!
I've prepared a form in Flash and I was wondering whether it's possible to check whether the required fields have been filled before the form is submitted...Here's something I tried but it's not really working properly. Any help would be really appreciated
Need Some Form Validation Help
Can someone give me a quick and short email validation script? I'm almost braindead after staring at code for 5 hours.
Big thanks!!!
Form Validation
I got a problem. My form Validation isn't working. Actually to be more accurate, the chEmail function works but I also need Flash to check the input fields "first" and "last" to make sure something is entered in there? Am I missing something here or done something wrong? Thanks peeps
Here's the code related to the validation
function ckName(){
if (formData.first == ""){
errBox.setMessage("Oop's, you forgot to fill in your first name");
return false; }
else {
return true};
}
function ckName(){
if (formData.last == ""){
errBox.setMessage("Oop's, you forgot to fill in your last name");
return false; }
else {
return true};
}
function ckEmail(){
if(formData.submit_by == ""){
errBox.setMessage("You Must Fill In Your Email Address");
return false;}
else{
if(formData.submit_by.indexOf(".",0)==-1 || formData.submit_by.indexOf("@",0)==-1){
errBox.setMessage("Your Email Address Is Not In Correct Form");
return false;}
else{
return true;}
}
}
Form Validation Not Quite Right?
Hi People,
I'm in the process of testing this flash email form:
http://www.tees.me.uk/booknew
NOTE: enter '27' in the 'Go To page ' text field and click go to be able to view the form.
Once you are viewing the form if you click send without entering any text/data into any field it allows you to send a blank submission. It should send you to a failure screen and tell you to start again, I can't figure out where it is going wrong??
The actionscript is as follows... (I've highlighted the area I think is causing the issue.
stop();
var senderLoad:LoadVars = new LoadVars();
var receiveLoad:LoadVars = new LoadVars();
// Adds conditional logic for the Submit button that
// validates user input.
this.send_BU.onRelease = function(){
if (emailInput.text ==""){
_root.demoForm.gotoAndStop("failed");
} else {
_root.demoForm.gotoAndStop("success");
}
}
sendBU.onRelease = function() {
senderLoad.nameInput = nameInput.text;
senderLoad.emailInput = emailInput.text;
senderLoad.companyInput = companyInput.text;
senderLoad.contacttelInput = contacttelInput.text;
senderLoad.countyCOMBO = countyCOMBO.value;
senderLoad.sendAndLoad("http://www.tees.me.uk/BookNew/send.php",receiveLoad);
}
receiveLoad.onLoad = function() {
if(this.sentOk) {
_root.demoForm.gotoAndStop("success");
}
else {
_root.demoForm.gotoAndStop("failed");
}
}
PHP code is as follows:
<?PHP
$to = "myemail@address.com";
$subject = "Online Flip Book Demo Request";
$message = "Name: " . $nameInput;
$message .= "
Email: " . $emailInput;
$message .= "
Company: " . $companyInput;
$message .= "
Telephone: " . $contacttelInput;
$message .= "
Location: " . $countyCOMBO;
$headers = "From: $emailInput" . "
";
$headers .= "Reply-To: $emailInput" . "
";
$headers .= 'Bcc: myemail@address.com. "
";
$sentOk = mail($to,$subject,$message,$headers);
echo "sentOk=" . $sentOk;
?>
Form Validation
I have a simple flash form, which has some required fields, ie. name, addy, etc.
What I want to do, is validate that the fields have been filled before they can hit the "next" button.
I've searched the forum, but found nothing, so I appologize if this has been asked before.
As you know, my AS understanding is intermediate at best, but I don't think this is beyond my capabilities.
thanks in advance, this will score big with the PM...
Rev
Form Validation
Hi guys, I've a problem, I've a form in flash, built with Input Text Fields, my Variables are:
Nombres
Apellidos
Empresa
Telefono
Email
Ciudad
Comentarios
and I want to validate all the fields before somebody submits the button, how I can do this?
thanks!
Form Validation
Hi, does anyone know how to validate flash textfields using an external javascript function before sending the data to the server? Or perhaps actionscript within the .swf can accomplish this. If anyone knows a good tutorial or simply has some actionscript I can customize, that would be great.
thanks,
ryan
Form Validation
hi,
can anyone recommend a tutorial on how to validate a form in flash 5? Can it be done with actionscript or do I need to create a javascript in my dreamweaver doc?
thanks!
Form Validation
Is there a simple way to make a field in a flash form a "required" field. A property I can easily check to see if a text field has any information in it?
Form Validation
Hi
I'm currently doing an ActionScript Mini Task assignment. We have to create a form in action script, like a mini e-commerce thing, nothing big or special or fully working, just to work with forms.
I can't find any tutorials anywhere on how to validate forms.
I need to validate my email address, so it only goes any further if it finds a @ and a .
I also have payment detail text fields where I need to set the maximum amount of characters.
This is my code for one of the text fields I want to set maximum characters to:
Code:
////////////////////
//CREATE CARD SECURITY NUMBER TEXT FIELD
////////////////////
Form.createTextField("secNum_txt", 12, 322, 245, 40, 20);
Form.secNum_txt.type = "input";
Form.secNum_txt.border = true;
Form.secNum_txt.text = "";
Form.secNum_txt.setTextFormat(FormFormat);
and this is the code for my e-mail address text field, which is the same really.
Code:
////////////////////
//CREATE E-MAIL TEXT FIELD
////////////////////
Form.createTextField("emailAddress", 3, xPos, 240, 160, 20);
Form.emailAddress.type = "input";
Form.emailAddress.border = true;
Form.emailAddress.text = "E-Mail";
Form.emailAddress.setTextFormat(FormFormat);
Then I have the 'next' button which onRelease stores all the data entered into variables, to display in dynamic text fields on the next frame. I know the email validation code should go into a function in this button, so this is the code I have for the button.
Code:
////////////////////
//next button places text from input forms in dynamic text fields on the ORDER Page.
////////////////////
next_Butt.onRelease = function() {
fName = Form.foreName.text;
sName = Form.surName.text;
email = Form.emailAddress.text;
sAddress = Form.streetAddress.text;
dAddress = Form.districtAddress.text;
tAddress = Form.townAddress.text;
pAddress = Form.postcodeAddress.text;
typeOfCard = Form.cardCombo.getSelectedItem();
cardNum1 = Form.cardNum1_txt.text;
cardNum2 = Form.cardNum2_txt.text;
cardNum3 = Form.cardNum3_txt.text;
cardNum4 = Form.cardNum4_txt.text;
secNum = Form.secNum_txt.text;
sDate = Form.startDate_txt.text;
eDate = Form.expireDate_txt.text;
gotoAndStop("Order");
};
Thanks in advance for any help
Gavin
Numeric Input Text Field Validation
I have a very simple form with 2 input text fields. The user enters numbers into the two text fields and with the click of a button, the two numbers are divided and then displayed in a dynamic text field. That's working.
What I want to do is validate that the values in the input text fields are actually numerical and not alphanumeric. How can I do this?
Also, I want to make sure that the user enters values into both fields. If they don't, a warning will appear and a dynamic text field in the warning will show the warning for this kind of error as well as an error for the datatype.
How can I do this?
UPDATE: I found a way to make sure the user enters numerical data:
textinput.restrict = "0-9";
Flash Form Validation?
Is there a way to validate forms before sending them to my cgi program? I also need to make sure the user enters in a email address (its a required field).
thanks.
Form Data Validation
I think i've bitten off more than i can chew here.....
i've created a form in flash and have attempted to use the FDK from macromedia ta validate the input data... i've followed the tutorial but when tested on "Sumit" i get a javascript error and the browser attempts to load the Get URL parameters from actionscript and not validate the form....the Dreamweaver components appear to be simple!!
Any one got any ideas please?
Chris
Form Validation With Flash 5
I've created a working mail form with the loadvariables action. I need to be able to check if the user correctly fills in the input fields. I know there are javascript files to do this when making a form mail in HTML. Can someone help me with this in Flash 5?
Thanks
Kevin
Form Validation Questions
I am using Flash MX and need to do age validation. Does anyone have an example or know where I can find a good example of how to do age validation in a form in flash?
Form Validation Problem...
I've got my flash form validation down pat, but I recently noticed that a few entries were coming through with null values...
After testing my scipts again, I soon worked out that the only way to create a null value is to press the space bar in each entry, except for the email, where you can just enter "@."
here's my code, in case you were wondering...
on (release) {
if (!web.length || web == "") {
_root.EmailStatus = "Please enter the name of the website";
} else if (!weburl.length || weburl == "") {
_root.EmailStatus = "Please enter the URL";
} else if (!webdesc.length || webdesc == "") {
_root.EmailStatus = "Please briefly describe the website";
} else if (!name.length || name == "") {
_root.EmailStatus = "Please enter your name";
} else if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
_root.EmailStatus = "Please enter a valid E-mail address";
} else {
loadVariablesNum("linkage.php", "0", "POST");
_root.EmailStatus = "Sending...";
}
}
Can anyone suggest a way I could trim the blank space from the entry so that people actally have to enter real values?
AS1: Form Validation Question
I am validating a form to make sure they are entering a first name, last name and email address.
You can see the example here:
www.kilgoretrout.net/index11.swf You will find the form on the contact page.
My problem is that the checks for first name and last name are not happening. Email address check seems to work fine. Can you tell me whats wrong?
Code:
function handleForm() {
first = Cmc.Cslide.Firstname.text;
last = Cmc.Cslide.Lastname.text;
test = Cmc.Cslide.Email.text;
if (first == undefined){
_root.submitInfo = "First name is required";
Cmc.Cslide.submitMsg.gotoAndPlay(2);
break;
}else if (last == undefined){
_root.submitInfo = "Last name is required";
Cmc.Cslide.submitMsg.gotoAndPlay(2);
break;
}else if (test.indexOf("@") == -1) {
_root.submitInfo = "A valid email address is required";
Cmc.Cslide.submitMsg.gotoAndPlay(2);
break;
}else if (test.indexOf(".") == -1) {
_root.submitInfo = "A valid email address is required";
Cmc.Cslide.submitMsg.gotoAndPlay(2);
break;
}else{
mailinglistVars.Firstname = Cmc.Cslide.Firstname.text;
mailinglistVars.Lastname = Cmc.Cslide.Lastname.text;
mailinglistVars.Address1 = Cmc.Cslide.Address1.text;
mailinglistVars.Address2 = Cmc.Cslide.Address2.text;
mailinglistVars.City = Cmc.Cslide.City.text;
mailinglistVars.State = Cmc.Cslide.State.text;
mailinglistVars.Zip = Cmc.Cslide.Zip.text;
mailinglistVars.Email = Cmc.Cslide.Email.text;
sendandgetData(4);
_root.submitInfo = "Thank you, your information has been sent";
Cmc.Cslide.submitMsg.gotoAndPlay(2);
Cmc.Cslide.Firstname.text = "";
Cmc.Cslide.Lastname.text = "";
Cmc.Cslide.Address1.text = "";
Cmc.Cslide.Address2.text = "";
Cmc.Cslide.City.text = "";
Cmc.Cslide.State.text = "";
Cmc.Cslide.Zip.text = "";
Cmc.Cslide.Email.text = "";
}
}
Thanks,
John Ziebro________
Multimedia Director
www.cogneato.com
|