Validating A Really Weird Number
Hi there.
First of all, this can be really boring and i apologize for my poor english (because i have to do a large explanation)
Im trying to validate a really weird number on an input textfield and id like some help on it.
But first i have to explain the logic on the number.
The first nine numbers are aleatory numbers, can be anything. The last two numbers are called "validation numbers" and theyre related to the previous nine.
So, lets imagine we have the following number
222 333 666 XY
X is calculated by the distribution of the digits and puting the values 10,9,8,7,6,5,4,3,2 just like the above:
2 2 2 3 3 3 6 6 6
10 9 8 7 6 5 4 3 2
On the sequence we multiply the columns:
2 2 2 3 3 3 6 6 6
10 9 8 7 6 5 4 3 2
20 18 16 21 18 15 24 18 12
We add each result like: 20+18+16+21+18+15+24+18+12
The result on this case will be 162
Now we make the division of 162 by 11
162/11 = 14 and a rest of 9
The rest defines the first validation number.
If the rest is less than 2, then X is 0
If the rest is more than 2 (our case) we do 11 - rest, in our case
11-9 and our X will be 2.
The number looks like this now
222 333 666 2Y
To find Y:
this time we use the same procedure but we add a number (since we also using the first validation number)
2 2 2 3 3 3 6 6 6 2
11 10 9 8 7 6 5 4 3 2
Multiply the columns
2 2 2 3 3 3 6 6 6 2
11 10 9 8 7 6 5 4 3 2
22 20 18 24 21 18 30 24 18 4
This results: 22+20+18+24+21+18+30+24+18+4=199
Since the rest of 199 /11 is less than 2 , the Y will be 0
The number is:
222 333 666 20
I have to validate this number, but i dont have any clues on how to do it , except , of course, the "lenght" of it, that should allways be 11 and that it have to be a number.
Ill apreciate any clues!
Thx
FlashKit > Flash Help > Flash ActionScript
Posted on: 05-23-2005, 11:45 AM
View Complete Forum Thread with Replies
Sponsored Links:
Validating If A Character Is A Number HELP
Hey All,
I'm trying to validate if a character entered by the user is a "number". These are NOT working.......
on(release) {
if (this.dayTxt.charAt(0) != Number || this.dayTxt.charAt(1) != Number || this.monthTxt.charAt(0) != Number || this.monthTxt.charAt(1) != Number || this.yearTxt.charAt(0) != Number || this.yearTxt.charAt(1) != Number || this.yearTxt.charAt(2) != Number || this.yearTxt.charAt(3) != Number)
{
this.errors._visible = true;
} else {
this.errors._visible = false;
}
}
Any help here would be fantastic.
jub
View Replies !
View Related
Validating Checkboxes++++HELP
I am putting a site together and have created a form which send variables to a PHP script.
The send button has actionscript which checks for the fields and states which fields the user has missed etc.
My problem is that I want to check that the user fills at least one of my four check boxes. I have no problems getting radio buttons to work as they all have the same variable name, but with check boxes as each has a different variable name I can only make it work if the user completes all the check boxes, which is no good.
Is there any way of checking that they've completed at least one of the boxes and then ignore them, but if they leave them all unchecked it will state they need to complete at least one.
I will gladly send anyone the source files and php etc, or anything else they need to solve this.
Hope you can help.
Thanks
Jason Dorsett
View Replies !
View Related
Validating Email
Hi, I'm building an email submission form in flash (mx) using php and I'd like to know how to check that the contact email given by the user is a valid one, not neccesarily if it is a real one, just if the specified one contains an '@' and an appropriate domain.
At the moment the 'submit' button checks to see that the required fields are filled in, and if so posts the variables to the php script and goes to a thankyou page using this script:
on (release) {
if (name eq "" or email eq "" or message eq "") {
stop();
} else {
loadVariablesNum("email.php", 0, "POST");
gotoAndStop(2);
}
}
Presumably the check for suffixes would have to be in 'if', I'm still getting to grips with mx (flash 5's still a bit engrained) so I don't know if there's a better way to do this in mx.
Any help would be much appreciated.
View Replies !
View Related
Validating Flash
Does anyone have know how to include a flash movie in HTML and have it validate as HTML 4.01 transitional?
This has been bugging me for a while and I'd appreciate some help if possible.
Thanks.
DalyCity
View Replies !
View Related
Validating An Email - 100 %
This could be tutorial but it is very simple. Originaly my problem was how to validate email. Couldnt find any better script then
if (!TFemail.text.length || TFemail.text.indexOf("@") == -1 || TFemail.text.indexOf(".") == -1)
ok this is fine but her we go to check all other thing that are importat @ and ., domain etc. It could be puted all in one if sentence but i left like it was, because that way i had better overview when you trace sometnihng at some point.
Still possible that sometning still missing to check or could be all in better layout. Hope that someone will grab this and make better and put it back.
*********************** VALIDATION EMAIL - what you neeed ***********************
I have lot of boxes to check in my version, but this is not important. You need one dynamic text box in this case named TFemail and one button that will check on release.
************************ ON release code *********************
on (release){
if (!TFemail.text.length || TFemail.text.indexOf("@") == -1 || TFemail.text.indexOf(".") == -1) {
trace("wrong email!");
}
else if (TFemail.text.indexOf("@") == 0 || TFemail.text.indexOf(".") == 0 || TFemail.text.indexOf("@") ==TFemail.text.length-1 || TFemail.text.indexOf(".") ==TFemail.text.length-1) {
trace("wrong email!");
}
else if (TFemail.text.lastIndexOf(".") < TFemail.text.length-5) {//max domain is .info (-4 but string strarted at 0 that way is -5).
trace("wrong email!");
}
else if (TFemail.text.indexOf("@") == TFemail.text.lastIndexOf(".")-1 || TFemail.text.indexOf("@") == TFemail.text.lastIndexOf(".")-2 || TFemail.text.indexOf("@") == TFemail.text.lastIndexOf(".")-3) {//must be min 3 char between @ and .
trace("wrong email!");
}
else if (TFemail.text.lastIndexOf(".") == TFemail.text.length-2) {//must be min 2 char. after last dot
trace("wrong email!");
}
else {
loadVariablesNum ("http://", 0, "POST");
}
}
View Replies !
View Related
Xml Path Not Validating....
Hi all,
I have this code that I need to validate xhtml transitional:
**I have edited this message twice but no code is showing - just look at the line of code fro the validator**
<object type="application/x-shockwave-flash" data="imagens/c.swf?path=imagens/roladas2.swf" width="492" height="394">
<param name="movie" value="imagens/c.swf?path=imagens/roladas2.swf" />
<param name="quality" value="high" />
<a href="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"><img src="imagens/home_roladas_estatica.jpg" width="492" height="394" alt="plug-in do Flash" /></a>
</object>
Here is the w3c validator's info:
Line 20, column 91: cannot generate system identifier for general entity "xmlPath"
.../lentixBase.swf?currentNav=expertise&xmlPath=swf/images.xml" width="504" heig
An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (. The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".
Entity references start with an ampersand (&) and end with a semicolon (. If you want to use a literal ampersand in your document you must encode it as "&" (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and æ are different characters.
Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.
So it has to do with the xmlpath but I dont know what to do to fix it. I have a file called images.xml that is in the SWF folder...There is a folder inside of the swf folder called 'media' that has all the images used in the flash movie.
Any ideas or is there some sort of fix for this I dont know about?
View Replies !
View Related
Validating With This Quiz Example
Working with this example for a related piece of work. But i was wondering how I could successfully go about making sure that if the user enters nothing then it does nothing but tell them to enter a answer?
Quote:
// generalized function to check an answer
function answercheck (q, answer) {
if (findword(eval("q"+q), answer) == true && q1.text != "") {
set("out"+q, "That is correct!");
} else {
set("out"+q, "That is incorrect. Please try again.");
}
// does the actual comparison
// determines if the answer is in the user's response
function findword (input, answer) {
var input = input.toLowerCase();
return input.indexOf(answer) != -1;
}
}
check1.onRelease = function() {
answercheck(1, "anim");
};
check2.onRelease = function() {
answercheck(2, "futurewave");
};
q1 & q2 being where they enter the questions
out1 & out2 being where the answer or response is displayed
and
check1 & check2 being the 'check' buttons.
Any help would be greatly appreciated.
View Replies !
View Related
Validating Languages
hi i doing a multi language site with external xml files.
I have problem for validate the current language.
When change section i can get the selected current language.
I explain me?
the fla is attached!
in the first frame of my section movie i put this
PHP Code:
load();
function load() {
if (idioma==0) {
getXML("xml/secciones_en.xml","myData",nextStep);
} else {
getXML("xml/secciones_es.xml","myData",nextStep);
};
}
an in my button
PHP Code:
//language button
on (release) {
idioma = 0
cargar();
}
SOME IDEAS?
tks anyway!
View Replies !
View Related
Validating Sequences
Hi there!
I often use the well known book by Franklin & Makar about Advanced AS2 Scripting.
But, despite the fact they provide excellent samples of validation routines (email validation for example), they do not provide any example of validating sequences for phone numbers.
In North America, we have a xxx xxx xxxx scheme.
In France, it's xx xx xx xx xx.
In Germany, it varies (!!!) : xxxxx xx xx or xxxx xxxxxxx or xxxxx xxxxx
In Great-Britain, xx xxxx xxxx
And so on...
Will somebody could give me tips and syntax examples to write a validation function which will work for many different countries?
(I know that this has something to do with "indexOf"...)
I am not afraid to write as many as twenty different cases !!!
:-)
Many thanks in advance for your help !
View Replies !
View Related
Validating A Form
Ok, basically i have an email form that does this:
- Validates fields if they are not filled in and displays error
- Sends email if it is filled
But... before i put the validator on, it went to a success message, but now it doesn't.
All that you do is fill in name, email, telephone and message and click submit and it emails
Attached is the FLA, if anyone could explain how and why this wont work id be grateful.
http://www.jasonmayo.co.uk/preview/golpys/booking.fla
Ok heres the code...
Form Movie Clip
Code:
onClipEvent(data){
gotoAndStop(2);
}
Actions Frame
Code:
stop();
form.name="";
form.email="";
form.phone="";
form.message="";
Submit Button
Code:
on (release) {
if(form.name == "" ){
gotoAndStop(3);
}
if(form.email == "" ){
gotoAndStop(3);
}
if(form.phone == "" ){
gotoAndStop(3);
}
else {
form.loadVariables("booking_submit.php","POST");
}
}
View Replies !
View Related
Validating Buttons HELP
I load XML and parse it in to 3 arrays
article = new Object();
article.date = new Array(); // holds calendar date
article.msg = new Array(); // holds message
article.link = new Array(); // holds links if any
// OTHER PARSE CODE...
article.date has values for loaded dates [1,17,18]
Then i have this:
// Object constructor (used to create multi-D arrays)
function createDiary (date, msg, link) {
this.date = date;
this.msg = msg;
this.link = link;
}
// Create our main array that will hold all of the XML values
entry = new Array();
// Populate the page array with Diary objects
function populateEntry() {//
for (var k = 0; k < article.msg.length; k++) {//
entry[k] = new createDiary(article.date[k], article.msg[k],
article.link[k] );
// Reference to my calendar that holds dates MC's // Here I'm showing that
1,17 and 18 are selected by going to frame 2
_root.boxHolder.holder["myBox" + entry[k].date].gotoAndStop(2);
// if I use K variable it will assign to tempDate 0,1,2 // if i use
entry[k].date it will take the values from my array
// which would be 1,17,18
_root.boxHolder.holder["myBox" + entry[k].date].tempDate = k;
_root.boxHolder.holder["myBox" + entry[k].date].onRelease = function(){//
I DONT KNOW WHAT TO PUT IN HERE... to validate which button pressed and to
load the appropriate message
FROM my msg array. I've tried a lot of things but cant get the result i
need. I'm not duplicating the dates but attaching them, so
i cant put the code inside of one button. How can i do it from _root???
}
//trace(entry[k].msg);
//trace(entry[k].link);
}
}
Just in case my XML document:
<cal monthID="4">
<date id="1">LALALA</date>
<link>http://www.hotmail.com</link>
<date id="17">Appointment with the dentist at 4:30</date>
<link>aaa</link>
<date id="18">Call Brainvisa Technologies. Speak to Mr. Amit Garg. Phone
number</date>
<link>http://www.hivoltmedia.com</link>
</cal>
View Replies !
View Related
Validating Forms In Flash
does anyone know how to validate a form in flash,
i'm submitting data to a cf page via a submit button, which gives an error if i leave a form field blank, so i need a script that validates
the form before i submit, an on focus leave possibly unsure of the exact syntax needed can anyone help pls.
D
View Replies !
View Related
Validating Linked Image In Url
Hi guys,
I have a form for an admin section of a site i am working on.
The form is for adding new news stories to the site(all in flash)
Anyways in the form there is an option to also add images to the site.
the image is just a text field for the url and a button to load it into an mc. simple enough this works fine...
fine as long as there is an image at the end of the link. If there is no image or a problem with the url entered i get this error in the output window:
Error opening URL "http://www.whatever.com"
this is fine is there is no image or a problem with the url there should be an error.
My question is how do i display this error from within flash so that the user see's that there is an error. just now all the users see's is the pre-loader sitting at 0%.
Cheers
Paul
View Replies !
View Related
Flash MX As1 ( Validating A Form)
I need this email validation to be like this:
If email is not 16 digits long, then dont send form, and yeild a result of : INVALID ENTRY or what I have in the code below. Can someone help me out?
fscommand("allowscale", "false");
//
// set some variables
//
mailform = "mailform.php";
confirm = "Processing Data";
action = "send";
//
// and focus on variable fname
//
Selection.setFocus("fname");
//
// validate email function
//
function validate(address) {
if (address.length>=16) {
{
{
{
return (true);
}
}
}
}
return (false);
}
//
// form check
//
function formcheck() {
if ((((email == null)) || (email.length<1)) || (email == "ERROR! Address not valid")) {
email = "ERROR! Address not valid";
action = "";
}
if (!validate(email)) {
email = "ERROR! NUMBER not valid";
action = "";
}
if (fname == null) {
fname = "ERROR! Name required";
action = "";
}
if (lname == null) {
lname = "ERROR! Name required";
action = "";
}
if ((validate(email)) && (email != "ERROR!") && (fname != "") && (lname != "")) {
action = "send";
loadVariablesNum(mailform, 0, "POST");
gotoAndPlay("wait");
}
}
stop();
View Replies !
View Related
Validating The LoadVars Variable
I am trying to validate the value of a variable loaded from the server.
Im getting the variable in a loadVars object, [ objloadVars.variableName ].
Im trying to validate it like so..
objloadVars.onLoad = function (success:Boolean){
If (success){
If (objloadVars.variableName == 1) {
Statements;
}
}
}
But this doesnt work. It doesnt work at the condition even though I can trace the loadVars.variablename = 1;
I thought it might have something to do with the datatype of loadVars.variablename, but I checked by using the get data type function that it is a string. So I adjusted the right hand of the condition to a string, but nada! Still didnt work.
I am out of ideas, any help would be appreciated.
Thanks.
View Replies !
View Related
Validating Contact Form
Hi all,
I have the following code in Flash:
stop();
Code:
var senderLoad:LoadVars = new LoadVars();
var receiveLoad:LoadVars = new LoadVars();
sender.onRelease = function() {
senderLoad.yourName = yourName.text;
senderLoad.theEmail = theEmail.text;
senderLoad.theMessage = theMessage.text;
senderLoad.sendAndLoad("send2.php",receiveLoad, "POST");
}
receiveLoad.onLoad = function() {
if(this.sentOk) {
_root.gotoAndStop("success");
}
else {
_root.gotoAndStop("failed");
}
}
However, I need a field validation added, that checks if the field has been left empty and preferably checks if the e-mail input has been properly formatted using an "@" for example.
I am not an Actionscripter and when I use a function like above, how would I go about incorporating something like this into the code I already have:
Code:
on (release) {
if (Number(initial_name) == 100 and Number(initial_email) == 100 and Number(initial_comment) == 100) {
loadVariablesNum("send2.php", 0, "POST");
gotoAndStop("success");
else {
_root.gotoAndStop("failed");
}
}
}
Any suggestions very much appreciated.
Thanks!
View Replies !
View Related
Validating Flash Form
Hi all,
I know how to validate an email address in a form, but i'm stuck on how I validate that the user has entered in:
1. A telephone number
2. A post code
Is there a simple method
Many thanks in advance
View Replies !
View Related
Validating Form Fields
Hi All,
I am using Flash 8;ActionScript 2.0.
I have a form with serveral input fields. I want to validate these fields. For example make sure the email input is in the correct format, that the telephone input has only numbers, etc.
All of the tutorials I have looked at attach the AS to the submit button. I do not want to do this. What I'd like to set up is have AS check the input field entry to make sure it's correct PRIOR to the submission of the form.
Is this possible?
This is the AS for the form with no validation:
tl = this;
initF();
stop();
//Tabs
nameTF.tabIndex = 1
emailTF.tabIndex = 2
companyTF.tabIndex = 3
phoneTF.tabIndex = 4
messageTF.tabIndex = 5
//End Tabs
sendBtn.onRelease = function() {
if (checkFormF()) {
sendEmailF();
} else {
tl.gotoAndStop("errorFrame");
}
};
function checkFormF():Boolean {
if (nameTF.text == "Name" || companyTF.text == "Company" || emailTF.text == "E-mail" || phoneTF.text == "Phone" || messageTF.text == "Message" || nameTF.text == "" || companyTF.text == "" || emailTF.text == "" || phoneTF.text == "" || messageTF.text == "") {
return false;
} else {
return true;
}
}
function sendEmailF() {
sendLV = new LoadVars();
receiveLV = new LoadVars();
receiveLV.onLoad = function(s) {
if (s) {
tl.gotoAndStop("thankyouFrame");
}
};
sendLV.name1 = nameTF.text;
sendLV.email = emailTF.text;
sendLV.message1 = messageTF.text;
sendLV.phone = phoneTF.text;
sendLV.company = companyTF.text;
sendLV.sendAndLoad("mailer5.php",receiveLV,"POST");
}
function initF() {
nameTF.text = "Name";
companyTF.text = "Company";
emailTF.text = "E-mail";
phoneTF.text = "Phone";
messageTF.text = "Message";
}
label_01 = "Name";
label_02 = "Email";
label_03 = "Company";
label_04 = "Phone";
label_05 = "Message";
nameTF.text = label_01;
emailTF.text = label_02;
companyTF.text = label_03;
phoneTF.text = label_04;
messageTF.text = label_05;
//
this.onEnterFrame = function() {
nameTF.onSetFocus = function() {
if (nameTF.text == label_01) {
nameTF.text = "";
}
};
nameTF.onKillFocus = function() {
if (nameTF.text == "") {
nameTF.text = label_01;
}
};
//
emailTF.onSetFocus = function() {
if (emailTF.text == label_02) {
emailTF.text = "";
}
};
emailTF.onKillFocus = function() {
if (emailTF.text == "") {
emailTF.text = label_02;
}
};
//
companyTF.onSetFocus = function() {
if (companyTF.text == label_03) {
companyTF.text = "";
}
};
companyTF.onKillFocus = function() {
if (companyTF.text == "") {
companyTF.text = label_03;
}
};
//
phoneTF.onSetFocus = function() {
if (phoneTF.text == label_04) {
phoneTF.text = "";
}
};
phoneTF.onKillFocus = function() {
if (phoneTF.text == "") {
phoneTF.text = label_04;
}
};
//
messageTF.onSetFocus = function() {
if (messageTF.text == label_05) {
messageTF.text = "";
}
};
messageTF.onKillFocus = function() {
if (messageTF.text == "") {
messageTF.text = label_05;
}
};
};
Your help is much appreciated,
Scott
View Replies !
View Related
Validating TExtFields...Agian :(
Sorry to keep reposting this but I am getting frustrated. Here's my deal. I need to validate 3 text fields: em, nm, ms
now i need to validate these fields and only if they are validated goto frame 10. could someone help?
-thanks
Digital
View Replies !
View Related
Trouble Validating Numbers
I am trying to validate that the user does not enter a number in the "city" textfield. Everything works fine unless the user enters two numbers (e.g., "77"). Any ideas?
Code:
function validateCity() {
if (city_box_input.text.length<4) {
errors.push("City name is not long enough.");
}numbers = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
matchfound = false;
i = -1;
while (++i < numbers.length) {
if (city_box_input.text == numbers[i]) {
matchFound = true
}
}if (matchfound == false) {
break;
}else if (matchfound == true) {
errors.push("City Names Cannot Contain Numbers.");
}
}
View Replies !
View Related
Trouble Validating Numbers
I am trying to validate that the user does not enter a number in the "city" textfield. Everything works fine unless the user enters two numbers (e.g., "77"). Any ideas?
Code:
function validateCity() {
if (city_box_input.text.length<4) {
errors.push("City name is not long enough.");
}numbers = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
matchfound = false;
i = -1;
while (++i < numbers.length) {
if (city_box_input.text == numbers[i]) {
matchFound = true
}
}if (matchfound == false) {
break;
}else if (matchfound == true) {
errors.push("City Names Cannot Contain Numbers.");
}
}
View Replies !
View Related
Validating Form Fields
Need some help here.
Has anyone ever scripted an AS to validate form fields?
I'm looking to validate that _root.name contains only letters and _root.age contains only numbers. i'm also looking for an email validating script?
i've tried to keep the script simple in some cases but doesn't work.
when trying to validate that _root.name has only letters, i used typeof but then realized that all my fields are string therefore it wouldn't work.
all this is being send to a database. would it be easier if i get the developer to validate the forms from his end of things?
View Replies !
View Related
Advanced Form Validating In JavaScript.
I hope this isnt too off topic, but I figured anyone profficient in ActionScripting might be able to help me out on this.
I'm having some problems getting my form to validate properly for the 'Age' field. An explanation and some help would be greatly appreciated if anyone knows.
The idea is for the form to provide an error dialogue if the Age field is blank or contains a number that is less than 13 (13 and above are accepted). It works fine if you put 1, 10, 11 or 12. However if you put a single digit such as 2 through 9 if reads this as acceptable. I'm guessing it relates to the fact that these numbers are in the tenths place and the script doesnt understand the decimal system, but really I'm not sure.
Here's a link to the form:
http://www.eckounlimited.com/unplug...ster/index.html
Here's the source:
<html>
<head>
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida
teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- You must specify a valid email address.
';
} else if (test!='R') {
if (isNaN(val)) errors+='- '+nm+' must contain a number.
';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (val<min || max<val) errors+='- Sorry, you must be at least 13 years old to register at Ecko.com. Please have your parent or legal guardian register your information for you.
';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.
'; }
} if (errors) alert('Warning: Invalid submission. Please observe the following...
'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>
<body marginwidth=0 marginheight=20 leftmargin=0 rightmargin=0 bottommargin=0 topmargin=20 bgcolor="#660000" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<BASEFONT FACE=ARIAL>
<FORM Action="http://www.ecko.com/cgi-bin/yform.cgi" Method="post" onSubmit="MM_validateForm('First Name','','R','Last Name','','R','Email','','RisEmail','Age','','RinRa
nge13:99999');return document.MM_returnValue">
<table width="320" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><font face="Arial, Helvetica, sans-serif" size="1" color="#666666"><b><font color=#b30113 size=2><font face="Arial, Helvetica, sans-serif" color="#FFFFFF" size="1">This
survey is about you, the Ecko clothing buyer. Please complete
this questionnaire by filling out the information in the
spaces provided. Filling this out today will register you
as a member of Ecko.com and allow us to keep you updated
on our new developments, products, and adventures. Thank
you for your continued support of Ecko.<br>
<br>
Please fill in the form below.</font></font><font color="#FFFFFF" size="1"><br>
<font face="Arial, Helvetica, sans-serif" color="#FF0000">Fields
marked with * are required.</font></font></b><font size="1"><br>
<font color="#FFFFFF"><br>
*First
Name:<br>
<input type="TEXT" name="First Name">
<br>
<br>
*Last
Name:<br>
<input type="TEXT" name="Last Name">
<br>
<br>
Street
Address:<br>
<input type="TEXT" name="Address">
<br>
<br>
City:<br>
<input type="TEXT" name="City">
<br>
<br>
State/Province:<br>
<input type="TEXT" name="State">
<br>
<br>
Zip
Code:<br>
<input type="TEXT" name="Zip">
<br>
<br>
Country:<br>
<input type="TEXT" name="Country">
<br>
<br>
*E-Mail
Address:<br>
<input type="TEXT" name="Email">
<br>
<br>
*Age:<br>
<input type="TEXT" name="Age">
<br>
<br>
*Gender:<br>
<select name="Gender">
<option value=" " SELECTED><font face="Arial, Helvetica, sans-serif">Select One</font></option>
<option value="M"><font face="Arial, Helvetica, sans-serif">Male</font></option>
<option value="F"><font face="Arial, Helvetica, sans-serif">Female</font></option>
</select>
<br>
<br>
Race:<br>
<select name="Race">Highest level of education completed: <option value=" " SELECTED><font face="Arial, Helvetica, sans-serif">Select One</font></option>
<option value="African American"><font face="Arial, Helvetica, sans-serif">African American</font></option>
<option value="White"><font face="Arial, Helvetica, sans-serif">White</font></option>
<option value="Asian/Pacific Islander"><font face="Arial, Helvetica, sans-serif">Asian/Pacific Islander</font></option>
<option value="Hispanic/Latino"><font face="Arial, Helvetica, sans-serif">Hispanic/Latino</font></option>
<option value="Native American"><font face="Arial, Helvetica, sans-serif"> Native American</font></option>
<option value="Other"><font face="Arial, Helvetica, sans-serif">Other</font></option>
</select>
<br>
<br>
Highest
level of education completed:<br>
<select name="Edu">
<option value=" " SELECTED><font face="Arial, Helvetica, sans-serif">Select One</font></option>
<option value="Graduated college"><font face="Arial, Helvetica, sans-serif">Graduated college</font></option>
<option value="Attended college"><font face="Arial, Helvetica, sans-serif">Attended college</font></option>
<option value="Some high school"><font face="Arial, Helvetica, sans-serif">Some high school</font></option>
<option value="Still in grades 1-12"><font face="Arial, Helvetica, sans-serif">Still in grades 1-12</font></option>
</select>
<br>
<br>
How
did you find this page?:</font><br>
<select name="Referer">
<option value=" " SELECTED><font face="Arial, Helvetica, sans-serif" color="#666666">Select One</font></option>
<option value="TagCD"><font face="Arial, Helvetica, sans-serif" color="#666666">Ecko Complex TagCD</font></option>
<option value="ComplexMag"><font face="Arial, Helvetica, sans-serif" color="#666666">Complex's Homepage</font></option>
<option value="Ecko.com"><font face="Arial, Helvetica, sans-serif" color="#666666">Ecko's Homepage</font></option>
</select>
<br>
<br>
<input type="Submit" value="Register" name="Submit">
</font></font></td>
</tr>
</table>
<input type=hidden name="html_redirect" value="http://www.ecko.com/register/thanks.html">
<input type=hidden name="mail_recipient" value="register@ecko.com">
<input type=hidden name="mail_subject" value="Registration at Ecko.com">
<input type=hidden name="mail_top">
<input type=hidden name="mail_listfields" value="First Name, Last Name, Address, City, State, Country, Email, Age, Gender, Race, Edu, Referer">
<input type=hidden name="mail_bottom">
<input type="hidden" name="data_filename" value="registration.txt">
<input type="hidden" name="data_fields_to_log" value="First Name, Last Name, Address, City, State, Country, Email, Age, Gender, Race, Edu, Referer">
<input type="hidden" name="data_listvertical">
<input type="hidden" name="data_delimiter" value=" ">
</FORM>
</body>
</html>
View Replies !
View Related
Validating Email Address Format
Hi,
I'm writing a user registration form in MX
I can't get my email validation actionscript working.
I am checking the address to be at least 6 characters long and for '@' and at least one '.'
I would also like to make sure it contains just alpha numeric characters + '-' but the first part is enough of a challenge.
Has anyone already written a email validation script
or can you help debug mine.
Thanks for looking
View Replies !
View Related
Checking / Validating Input Fields
I did perform a search to see if this was already covered but nothing seemed to match so:...
I want to validate an input field for an email address so I'd like to check ig the input text contains the string "@" I guess...
does anyone know how'd I'd do this?
As always thanks heaps!
SS
View Replies !
View Related
Simple Problem About Validating Variables
i am trying to set up a login system, on the stage there are 2 input text feilds, username and userpass as their instance names
the VAR name are flashusername and flashuserpass respectively
also on the stage is a dynamic textfeild wiv the VAR of Status
there is a button on the stage once clicked i wud like it to validate the inputs and display a correct status. i have this code...
Code:
on (release, keyPress "<Enter>") {
if (flashuserame == "" && flashuserpass == "") {
Status = "Login Failed! - Please check you have entered both a username and password";
}
else {
Status = "Begin Login Process - Wait...";
//loadVariablesNum("PHP/Login.php", 0, "POST");
}
and no matter what i do, it will always jump to the else, even if there is no input or an input.
i am sure that i have done is correct but it doesnt wanna work >_< hope someone can help
View Replies !
View Related
Validating A PHP E-mail Form : Flash MX Pro
Does anybody have a php script that validates an e-mail address from a Flash form? I had the script, but prolly deleted it inadvertently.
Particularly, I'm looking for a php script to checks to see if an e-mail is valid or not. I'm using Flash MX professional...any help would be certainly be appreciated...
Flamboyant Flasher
View Replies !
View Related
Validating Scroll In MultiLine Text Box
Hi, I have a simple that when pressed moves the multiLine text box to line 31, like so:
on (press) {
info.scroll=31
}
Question:
How can i listen to when the scroll is at line 31 then do something?
for example, something alond the lines of:
if (info.scrollPosition == 31) {
button._visible="true"
}
View Replies !
View Related
[F8] Validating Component's Inspectable Properties
Hi!
I'm developing a component and I want to allow the user to customize it thru the Paramenter Inspector/Component Inspector. I define some properties as Inspectable.
Is there any way to validate the values set to those properties by the user at authoring time?
For example, consider the following property:
code:
public function get radiusX():Number{
return itsRadiusX;
}
[Inspectable(name="Radius X", type=Number, defaultValue = 250)]
public function set radiusX(aRadius:Number):Void{
itsRadiusX = aRadius;
}
Once the user set a new value for the radiusX property (in the component inspector), I want to check if that value is greater than the component width. If it is, I want to set the radiusX to the component width and reflect this value in the component inspector.
Does any one knows how to do this?
Thanks,
Leo
View Replies !
View Related
[F8] Problems Validating Contact Form
i am having trouble validating a contact form. ON testing, i always get a false result, even if the txName or txEmail have values, the form reloads a blank and still traces "false"
Code:
var valid:Boolean=false
submit.onRelease=function(){
validateForm()
}
function validateForm() {
if (form.txName.text=" ") {
trace("no name")
}if(form.txEmail.text=" "){
trace("no email")
}else{
valid=true
}
sendForm()
}
function sendForm() {
trace(valid);
if (valid) {
trace("valid");
lvSend.user_name = form.txName.text;
lvSend.user_email = form.txEmail.text;
lvSend.user_city = form.txCity.text;
lvSend.user_note = form.txNote.text;
lvSend.sendAndLoad(rootURL+"contact.php", lvGet, "GET");
}
}
i'm sure the answer is somethign simple...but i have tried many variations to get this to work...anythoughts?
View Replies !
View Related
Sending EMail And Validating Fields
Am I just being dumb or do I not understand this fully? I am trying to make sure that the value of the two email fields are not blank and then pas the variables to an asp page that sends the actual email. Instead Actionscript seems to pass over the fact that the fields are empty and goes right to frame 15 and does pass on the variables.
Here is my Actionscript:
stop();
// onRollOver
this.submitBtn.onRollOver = function() {
submitBtn.gotoAndStop (2);
}
// onRollOut
this.submitBtn.onRollOut = function() {
submitBtn.gotoAndStop (1);
}
// -------------------<send form LoadVars>------------------- \
var senderLoad:LoadVars = new LoadVars();
var receiveLoad:LoadVars = new LoadVars();
submitBtn.onRelease = function() {
senderLoad.theName = theName.text;
senderLoad.theEmail = theEmail.text;
senderLoad.sendAndLoad("http://www.dannyboytheplay.com/subscribe.asp",receiveLoad);
}
receiveLoad.onLoad = function() {
if(sentOk==Sent) {
gotoAndStop(15);
}
else{
gotoAndStop(10);
}
}
// -------------------</send form LoadVars>------------------- \
Here is My ASP
<%
On error resume next
Dim strSenderName, strSenderAddress
strSenderName = Request("theName")
strSenderAddress = Request("theEmail")
Dim mySmartMail
Set mySmartMail = Server.CreateObject("aspSmartMail.SmartMail")
.......
Dim sentOk
if err.number <> 0 then
response.write("sentOk=Failed")
else
response.write("sentOk=Sent")
end if
set mySmartMail = nothing
%>
View Replies !
View Related
Validating Drop Downs In Flash
Hi,
I'm having a hard time figuring out how to validate a flash form's drop down menus, and was hoping I can get enlightened.
I know I can validate fields with this code:
Code:
else if (!ToName.length) {
EmailStatus = "Please Enter the name of how you are sending this to";
}
View Replies !
View Related
Validating Multiline Text Field
I'm having problems validating a multiline text field.
Here's my code:
Code:
if(txt.text==""){txt.text="please enter an answer"}else{gotoAndStop(2)};
When I test it, and hit the submit button, it just goes right to second frame, but when I change the text field to a single line field, it works perfectly.
How can I do the same thing to a multiline text field?
View Replies !
View Related
Validating Quotation In The Input Text Box
Hi All
I want to validate the content starting and ending with quotation symbol in the input text box, User need to type there content with the quotes (“”) in the input text box. Then i need to validate the user's content with the quotes
Eg. Let take text1 is my input text filed. And my answer is "Adobe"(Answer includes quotes also")
If I do like this
Text1.text = ““Adobe””
Error happens
Can any one suggest me to achieve this.
Thank you
View Replies !
View Related
Trouble Validating Input Text
Hi all. Just wondering if anyone can help. I'm trying to validate a text input field for email address only if there is actual text inserted. If the input is left blank then the playhead goes to the "end" frame. If there is an error in the text such as no @ symbol , then the playhead goes to the "error" frame. the problem is that when I enter a valid email, my send button doesn't do anything at all, it seems to become inactive. I can't figure out what the problem is in my code. Could someone help me out? send_pb is my button. Here's my code:
Attach Code
send_pb.addEventListener("click", sendListener);
function sendListener(event:Event) {
if(email.text != "") {
if (email.text.indexOf("@") < 1
|| email.text.indexOf("@") == email.text.length -1
|| email.text.indexOf("@") !== email.text.lastIndexOf("@")) {
gotoAndStop("error")
}
} else {
gotoAndStop("end");
}
}
Edited: 03/08/2008 at 02:20:48 PM by fileslasher
View Replies !
View Related
Validating Html Generated By Flash
Now I have stucked into validation. It may be nerdy with w3 and all that, but I really like the idea of some ISO-like standard for the web.
There's actually no problem getting html pages validated, but most of the web contains errors and work fine anyway.
The thing I wonder is: What doctype (DCD) is the html file that is generated by flash? For example, w3's validator says there is no attribute "LEFTMARGIN" and there's no tag such as <EMBED>. Of course there is, but not in that DCD. (flash generates no DCD)
Is there a way to get around this an make a tidy code? Should one bother at all?
Check your sites here (or check w3 itself!)
http://validator.w3.org/
http://infohound.net/tidy/
View Replies !
View Related
Trouble Validating Input Text
Hi all. Just wondering if anyone can help. I'm trying to validate a text input field for email address only if there is actual text inserted. If the input is left blank then the playhead goes to the "end" frame. If there is an error in the text such as no @ symbol , then the playhead goes to the "error" frame. the problem is that when I enter a valid email, my send button doesn't do anything at all, it seems to become inactive. I can't figure out what the problem is in my code. Could someone help me out? send_pb is my button. Here's my code Try it for yourself if you want. 3 frames, an input text and button on frame1, frame2 labeled error, frame3 labeled end.
send_pb.addEventListener("click", sendListener);
function sendListener(event:Event) {
if(email.text != "") {
if (email.text.indexOf("@") < 1
|| email.text.indexOf("@") == email.text.length -1
|| email.text.indexOf("@") !== email.text.lastIndexOf("@")) {
gotoAndStop("error")
}
} else {
gotoAndStop("end");
}
}
View Replies !
View Related
Validating Html Generated By Flash
Now I have stucked into validation. It may be nerdy with w3 and all that, but I really like the idea of some ISO-like standard for the web.
There's actually no problem getting html pages validated, but most of the web contains errors and work fine anyway.
The thing I wonder is: What doctype (DCD) is the html file that is generated by flash? For example, w3's validator says there is no attribute "LEFTMARGIN" and there's no tag such as <EMBED>. Of course there is, but not in that DCD. (flash generates no DCD)
Is there a way to get around this an make a tidy code? Should one bother at all?
Check your sites here (or check w3 itself!)
http://validator.w3.org/
http://infohound.net/tidy/
View Replies !
View Related
Help: Weird Or Not So Weird Thingy With Dynamic Text Animation
http://www.david.bullaro.com/
there are 3 buttons on the right side education, experience and awards. Each loads an MC that then motion tweens into view from the side. The MC dynamically loads a text file. At the end the text blinks once. I understand the blink because i needed to reload the text for that keyframe but is there anyway around that blink?
TIA.
View Replies !
View Related
Validating Text In Input Field W/o Trigger
Hello,
I am working on an interactive online application training module using Flash 5.
I have a task which I need to simulate using ActionScript:
1. User types a specific name, e.g. "martin" (lower or upper case) into an input text field (which sits on a screen grab of a window). The name has a fixed length.
2. The name is validated automatically.
NOTE: The user is not required to click a button, e.g. "Submit" for the name to be validated, i.e. there is no trigger!
3. If the name was correctly typed, the play-head is advanced to a new frame (with a new screen grab). Else the user needs to try again.
Could someone please help me out with the ActionScript. Your help will be greatly appreciated.
View Replies !
View Related
Validating Components And Sending Data To A Php File
I have created a form with input text fields, and components. The components I have used are a list box and a combo box. What I would like to do is validate my components, and then submit there variables to my php file. Also I would like to, make them prompt the user whether or not they have selected the state or country.
here is the fallowing code that calls up information for my lis box and combo box also the as files.
stop();
#include "form_validate2.as"
#include "contact2.as"
// set just in case
// The labels in the listbox
myLabels = new Array("USA", "Canada", "Bahrain", "Chile", "China", "France", "Malaysia", "Protugal", "Taiwan R.O.C.", "Venezuela", "Albania", "Algeria", "American Samba", "Antarctica", "Argentina", "Australia", "Austria", "Bahamas", "Bangladesh", "Barbados", "Belgium", "Belize", "Bermuda", "Bolivia", "Bosnia and Herzegovina", "Brazil", "Bulgaria", "Columbia", "Costa Rica", "Croatia", "Cuba", "Czech Republic", "Denmark", "Denmark", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Finland", "Germany", "Guam", "Hong Kong SAR", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Jordan", "Korea", "Kuwait", "Lebanan", "Lithuania", "Mexico", "Morocco", "Netherland", "Norway", "Peru", "Philippines", "Poland", "Puerto Rico", "Romania", "Russia", "Samoa", "Saudi Arabia", "South Africa", "Spain", "Sweden", "Switzerland", "Syria", "Turkey", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Virgin Islands");
// Populate the listbox
for (i=0; i<myLabels.length; i++) {
country_str.addItem(myLabels[i]);
}
// Display function
function listDisplay(component){
list = component.getSelectedItem().label;
}
// You get the picture
country_str.setChangeHandler("listDisplay");
// The labels in the listbox
myLabels = new Array("Alabama", "Alaska", "Alberta", "American Samoa", "Arizona", "Arkansas", "British Columbia", "California", "Colorado", "Connecticut", "Delaware", "District of Columbia", "Fed. States of Micronesia", "Florida", "Georgia", "Guam", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Marshall Islands", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "Northern Mariana Islands", "Ohio", "Oklahoma", "Ontario", "Oregon", "Palau", "Pennsylvania", "Puerto Rico", "Quebec", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virgin Islands", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming");
// Populate the listbox
for (i=0; i<myLabels.length; i++) {
state_str.addItem(myLabels[i]);
}
// function to display the selection
function comboDisplay (component) {
combo = component.getSelectedItem().label;
}
// We assign the function to the combobox
state_str.setChangeHandler ("comboDisplay");
"I have also attatched the as file for contact2.as, which is in the txt format and not the as format"
Thanks!
Abel Gudino
View Replies !
View Related
Validating Input Text - How To Make It Easier....
Hello all,
I am using Flash MX and have created a crossword puzzle. I am trying to reduce the code/time necessary to code it.
Here is what I currently have:
function check_answers(){
one = m1v + m2v + m3v + m4v + m5v + m6v + m7v + m8v + m9v + m10v + m11v;
two = ru1v + ru2v + ru3v + ru4v + m2v + ru5v;
if ((one == "maintenance") && (two =="runway")) {
gotoAndStop("right");
} else {
gotoAndStop("missed");
}
}
Is there an easier way to do this? I have used arrays for other things, but nothing requiring validating multiple var instances. Any help would be greatly appreciated.
Thanks in advance.....
View Replies !
View Related
|