Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




How To Validate A Form's Text Field



I'm not very good with scripting, and am having a problem with a simple form that has 3 states: the form itself; an "invalid" error frame; and a "thanks" frame for successful submissions.

I need to setup 2 conditions for a field, in which the user types in their name. it's named "lotusnotesID".

if the field has any blank spaces, it should goto the "invalid" frame that displays an error message and asks them to retype their ID. if the field doesn't have any periods between their name (e.g. john.m.smith) they should goto the "invalid" frame and retype their ID.

my actions are set up in a button within the form. it reads as follows:

on (press) {
if (lotusnotesID == "Key.SPACE" ne "." ne "") {
gotoAndStop ("invalid");
} else {
loadVariablesNum ("http://creativeservices.accenture.com/client.stage/sfmoma/cdontsMail.asp", 0, "POST");
gotoAndStop ("thanks");
}
}


as far as I can tell, it's setup correctly. the problem is that when I test it, the submit button will take me to the "invalid" frame if the text field contains a space, or is missing a period, or is blank, but once I'm in the "invalid" frame and retype the ID correctly, it won't submit properly and goto the "thanks" frame. also, if I type the name correctly initially, it works fine.

am I using the correct operators? any ideas?

thanks very much,
dan
eeth22@yahoo.com



FlashKit > Flash Help > Flash ActionScript
Posted on: 07-06-2001, 05:07 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

How Do I Validate This 3 Field Form?
Here is my function checkForm.

3 Fields - Name, Message & Email

Name = This should be more than 1 character
Message = This should be more than 1 character
Email = This is booleon set (True or False)

If these 3 Fields meet up to this criteria - I would like it to proceed to the else statement I have below.

I would like a method of validation which is alot more effective than the one used below:


ActionScript Code:
function checkForm() {
   
    var myName = _root.pages_mc.nameField.text;
    var myMessage = _root.pages_mc.messageField.text;
    var myEmail = _root.pages_mc.emailField.text;
   
    //VALIDATE NAME & MESSAGE FIELD
    if (myName == ""){
        _root.pages_mc.errorField.text = "Please fill out your name";
        Selection.setFocus(_root.pages_mc.nameField);
   
    } else if (checkEmail(myEmail) == false){
        _root.pages_mc.errorField.text = "You have entered an invalid email address";
   
    } else if (myMessage == ""){
        _root.pages_mc.errorField.text = "Please leave a message";
        Selection.setFocus(_root.pages_mc.messageField);
   
    } else if (myEmail == ""){
        _root.pages_mc.errorField.text = "Please write your email address";
        Selection.setFocus(_root.pages_mc.emailField);
   
    } else {
            _root.pages_mc.errorField.text = "";
            myXML.firstChild.appendChild(myXML.createElement("entry"));
            myXML.firstChild.lastChild.attributes.myName = myName;
            myXML.firstChild.lastChild.attributes.myEmail = myEmail;
            myXML.firstChild.lastChild.appendChild(myXML.createElement("myText"));
            myXML.firstChild.lastChild.lastChild.appendChild(myXML.createTextNode(myMessage));
            myXML.sendAndLoad("processXML.php", receiverXML);      
        }
}

I've tried it running the function above and it seems to process the else statement when the if statements say otherwise. So a better method would be really helpful.

How Can I Validate A Field On A Flash Web Form?
I'm trying to create a Flash web form. I have many fields like Email, username and so on. I would like to add a code to validate the email, How can I program the Flash to report an error if the Email is invalid? or if the username is empty?
Thank you

[cs3] Flash Form: Validate Country Field
hello , had a quick question i hope. on my flash form i'm trying to validate
the country feild ..

country_txt.text != '' &&

client wants a territory restriction on any country but United States..
so if the user types in USA, U.S.A , America , North America, US or United States they can submit the form. any other countries entered will get a error msg "territory restricted"

any help is much appreciated..

thanks, j

here is my script..


PHP Code:



//presistant reference to this movie's mail timeline:
var mainTL:MovieClip = this;

//start off with submit button dimmed
submit_mc._alpha = 70;

//create the LoadVars objects which will be used later
//one to send the data...
var dataSender:LoadVars = new LoadVars();

//and one to recieve what comes back
var dataReceiver:LoadVars = new LoadVars();

/*
create listener for Key Object
this is just a U.I. thing - "wakes up" the submit button
when all fields have at least some content
*/

var formCheck:Object = new Object();
formCheck.onKeyUp = function() {
    alert_txt.text = '';
    if (first_txt.text != '' &&
        last_txt.text != '' &&
        age_txt.text != '' &&
        email_txt.text != '' &&
        zip_txt.text != '' &&
        country_txt.text != '' &&
        cell_txt.text != '' &&
        carrier_txt.text != '' &&
        email_txt.text.indexOf("@") != -1 &&
        email_txt.text.lastIndexOf(".") != -1) {
        //clear any alert messages
        alert_txt.text = '';
        //enable the submit button
        submit_mc._alpha = 100;
        } else {
        //remain disabled until all fields have content
        submit_mc._alpha = 70;
    }
}

Key.addListener(formCheck);

/*#######SET STYLES FOR TEXT FIELDS#######*/

//define styles for both normal and focussed
//set hex values here that work with your site's colors

var normal_border:Number = 0x666666;
var focus_border:Number = 0xF6B9DB;

var normal_background:Number = 0x666666;
var focus_background:Number = 0xE9E3E3;

//var normal_color:Number = 0x776D6C;
var normal_color:Number = 0xF6B9DB;
var focus_color:Number = 0x000000;

//create an array containing the fields we wish to have styles applied to

inputs=[name_txt,company_txt,phone_txt,fax_txt,email_txt,date_txt,duration_txt,guests_txt,catering_txt,nature_txt];

/*
a "for in" loop now iterates through each element in the "inputs" array
and applies our "normal" formatting to each input text field
*/

for( var elem in inputs) {
    inputs[elem].border = true;
    inputs[elem].borderColor = normal_border;
    inputs[elem].background = true;
    inputs[elem].backgroundColor = normal_background;
    inputs[elem].textColor = normal_color;
    /*this takes care of applying the "normal" style to each of the four input fields;
        the following TextField prototypes handle highlighting when an input field
        gains focus and resetting to normal when a field loses focus*/
    inputs[elem].onSetFocus = function() {
        this.borderColor = focus_border;
        this.backgroundColor = focus_background;
        this.textColor = focus_color;
        }
    inputs[elem].onKillFocus = function() {
        this.borderColor = normal_border;
        this.backgroundColor = normal_background;
        this.textColor = normal_color;
    }
}

//finally: make the first field (name_txt) selected when the movie loads

Selection.setFocus(name_txt);

/*DEFINE SUBMIT BUTTON BEHAVIOR*/

submit_mc.onRelease = function() {
    //final check to make sure fields are completed
    if (first_txt.text != '' &&
        last_txt.text != '' &&
        age_txt.text != '' &&
        email_txt.text != '' &&
        zip_txt.text != '' &&
        country_txt.text != '' &&
        cell_txt.text != '' &&
        carrier_txt.text != '' &&
        email_txt.text.indexOf("@") != -1 &&
        email_txt.text.indexOf(".") != -1) {
        alert_txt.text='';//clear any previous error messages or warnings
        //assign properties to LoadVars object created previously
        dataSender.first = first_txt.text;
        dataSender.last = last_txt.text;
        dataSender.phone = age_txt.text;
        dataSender.email = email_txt.text;
        dataSender.zip = zip_txt.text;
        dataSender.country = country_txt.text;
        dataSender.cell = cell_txt.text;
        dataSender.carrier = carrier_txt.text;

        //callback function - how to handle what comes abck
        dataReceiver.onLoad = function() {
            if (this.response == "invalid") {
                mainTL.gotoAndStop(1);
                alert_txt.text = "Please check email address - does not appear valid."
            } else if (this.response == "passed") {
        mainTL.gotoAndStop(4);
            }
        }
        //now send data to script
        dataSender.sendAndLoad("processEmail.php", dataReceiver, "POST");
    } else {
        //warning if they try to submit before completing
        alert_txt.text = "Please complete all fields before submitting.";
    }
}

Validate Text And Submit The Text On To A New Field
Hi am having problem wiht my validation
im tryin to validate a text, which does the action below:

function validateMessage () {
var arr = []; // create an empty array
var msg = msg.text; // set var to the current text field

arr = msg.split(" "); // split each word into our array

if (arr.length > 10) { // if the array is longer than 10
// return a value of false to var istrue
} else { // if the array is less 10
// return a value of true to var istrue
}

but if i try to use the on realse method which send the text on to new screen and i use GotoAndStop (frame) to send it to the next frame.

I tried this bu t im getting problem, i can't seem to make the validation work correctly, it should only allow you to go through if you enter less then 10 words, if not it would send out and error message which is

error_msg.text = "You've exceeded 10 words, Please Try Again"; // do something

Trying To Pass Text From Form Text Field To A Flash Dynamic Text Field
Hi, I was hoping someone might enlighten me as to how/if I can do this...

Currently I'm using javascript which works fine to pass text from textfield A to textfield B:


Code:
window.onload=function()
{
document.forms.form1.shirtText.value=document.forms.form1.KitGroupID_16_TextOption_38.value
}
Is there a way to pass the textfield A text to a dynamic text input (flash) as I'd like to use the font embedding flash offers. I can make it work when loading a value from a txt file but I'm not sure how to access the value identified above as KitGroupID_16_TextOption_38 and make it appear in a dynamic input box. Eventually I might want to have 3 font choices for the user but I'd like to just see if I can get this working properly first.

Your help/advice would be greatly appreciated,

-Scott

Validate A Date Field
I need to know how to validate a date field in Actionscript.

Is this possible? I know it is isDate() in CF.

Help.

Validate A Form
Hi,

I have been trying to make a sort of flash mx plugin for my swishmovie. It's a form that have the actions to posts the textboxes to a cgi script. It all works but I keep getting empty forms so I would like to validate some fields: like an e-mail has to have a "@" and a "." in it and another field may not be blank. So far no luck. I did some searching on this board but couldn't understand it at all cause i'm a real newbie.

This is what my submit button does:

on(press)
{

getURL ("http://users.scoutnet.nl/cgi-bin/mail-a-form.cgi", "nullframe", "POST");

GotoAndStop(2);
}

Where frame 2 is a 'thank you' message.

Any helps would be greately appriciated

Thanks!

Validate Form
How do I post a form that has required fields, and lets the use know if they didn't fill them all in, before it submits to an email program?

Validate Form Fields
Folks:

Is there any way for me to validate user input in a form field? Here's the problem in a nutshell.

This is an educational flash movie. I want to verify that the user has entered the correct information in the text box. For example, if I tell them to enter the number 10 in the text box and they enter 11, the feedback will be something like "you entered the wrong number. try again." If they enter the right number they will move on to the next step.

The text field must be validated when the user presses the Enter key.

This solution has to be Flash 4 compatible because there is not Flash 5 plug-in for some UNIX machines (which are part of the target market).

Any help would be great.

Using Button To Validate Form
It's my first time I'm making a form in flash. As to how to validate, I'm not exactly sure. My idea was that when you hit the submit button, it does the validation and if any of the validations fail, it sets a dont-submit flag and displays an error message in the form of a box that pops up. Anyways, it doesn't seem to work: the box isn't poping up or anything else. Any ideas?

I defined error in my form frame actions:
function error(message) {
errorBox._visible = true;
errorBox.message = message;
}

And heres my code for the submit button:
on (release) {
submitGo = true;
// Checks
if (_root.name == "" || _root.name == " ") {
error("Please tell us your name.");
submitGo = false;
}
if (_root.company == "" || _root.company == " ") {
error("Please tell us your company name.");
submitGo = false;
}
if (_root.phone == "" || _root.phone == " ") {
error("Please tell us a phone number where we can contact you.");
submitGo = false;
}
if (_root.email == "" || _root.email == " ") {
error("Please tell us an e-mail address where we can contact you.");
submitGo = false;
}
if (_root.feedback == "" || _root.feedback == " ") {
error("Please give us some feedback.");
submitGo = false;
}
// Sending vars
if (submitGo == true) {
loadVariablesNum ("infoRecieve.asp", 0, "POST");
}
}

Form Validate Problem
Have a simple form in flash with 5 fields, contactname, subject, phone, email, and comments. Would like to do a validate on only two fields. Have this on a submit button that sends it to a php script that sends an email to my address.

on (release) {
if (email eq "") {
_root.response = "Required field incomplete";
}
if (comments eq "") {
_root.response = "Required field incomplete";
} else {
_root.response = "Sending Data...";
loadVariablesNum("email_scrpt/email_scrpt.php", 0, "POST");
}
}

Everything works but only the two fields, email and comments are sent in the email even if I fill in all the fields. Everything worked fine until I did the validation. How do I pass the other variables and only have two checked?

Thanks in advance

RSL

Flash Form Validate Problem
Hi All,

I have set up my form in flash using ASP and it all works fine. However, I cannot seem to get the validating fields option to work. The two fields I want to have validated are Name (name_box) and Email (email_box).

Thanks heaps.

Here is the code I am using:

__________________________________________________

on (release) {
if (name_box ne "" and email_box ne "") {
loadVariablesNum("http://www.creativeconcepts.com.au/cgi-bin/email.asp", 0, "POST");
gotoAndPlay("valid");
} else {
gotoAndPlay("invalid");
}
}

__________________________________________________

and the ASP

__________________________________________________

<%@ LANGUAGE="VBSCRIPT" %>
<%
Sub Write(strWriteThis)
response.write(strWriteThis & "<br>")
end sub

%>
<%
strFrom=request.form("email")
strTo="rob@creativeconcepts.com.au"
strSubject = "Creative Concepts Website Response"
strBody="Name: " & request.form("name") & CHR(13) & "Company: " & request.form("company") & CHR(13) & "Phone: " & request.form("phone") & CHR(13) & "Email: " & request.form("email") & CHR(13) & "Comments: " & request.form("comments")

Set myCDONTSMail = CreateObject("CDONTS.NewMail")

myCDONTSMail.Send strFrom,strTo,strSubject,strBody,strContent

Set myCDONTSMail = Nothing
%>

Flash Form Validate Problem?
Hi All,

I have set up my form in flash using ASP and it all works fine. However, I cannot seem to get the validating fields option to work. The two fields I want to have validated are Name (name_box) and Email (email_box).

Thanks heaps.

Here is the code I am using:

__________________________________________________

on (release) {
if (name_box ne "" and email_box ne "") {
loadVariablesNum("http://www.creativeconcepts.com.au/cgi-bin/email.asp", 0, "POST");
gotoAndPlay("valid");
} else {
gotoAndPlay("invalid");
}
}

__________________________________________________

and the ASP

__________________________________________________

<%@ LANGUAGE="VBSCRIPT" %>
<%
Sub Write(strWriteThis)
response.write(strWriteThis & "<br>")
end sub

%>
<%
strFrom=request.form("email")
strTo="rob@creativeconcepts.com.au"
strSubject = "Creative Concepts Website Response"
strBody="Name: " & request.form("name") & CHR(13) & "Company: " & request.form("company") & CHR(13) & "Phone: " & request.form("phone") & CHR(13) & "Email: " & request.form("email") & CHR(13) & "Comments: " & request.form("comments")

Set myCDONTSMail = CreateObject("CDONTS.NewMail")

myCDONTSMail.Send strFrom,strTo,strSubject,strBody,strContent

Set myCDONTSMail = Nothing
%>

How To Validate Form With Javascript In Flash ?
I need to validate form in Flash with the use of of Javascript. But I haven't done it so far...please send me some suggestions or tutorial link. Any sort of help would be highly praised.Thanx in advance.

Help To Validate A Form In Flash 5 Learning Simulation
I'm creating a learning simulation with a form field that requires the word "David" to be entered. If "David" is not entered correctly, when the user pushes the button the message "incorrect--please type David" will appear in another form field. If "David" is entered correctly, the movie will proceed to the next frame when the button is pushed. Can someone give me a simple bit of code to validate this form?

Thanks

[F8]how To Validate Year Entry? Flash Form Help
Hi I am making a form in flash and I am wondering what AS is needed so the text input for the year entry only accepts 4 digits? i.e. you cant type 20007 or 207 it has to be 2007..

[AS]add A Form Into Text Field
Hi, I just wondering if I can add a form into a text field, is there anyway to do it? any component or tutorial on this? thank you~

Form Field Text Formatting Help
hello guys and a happy new year

I have once again started tinkering about with another part of my site. the form fields for contact, postnew(forum), postMsg(siteinbox) I am trying to take away the basic formatting sys i have
code:
//Bold but
msgfield.text+=msg+" <b>type bold text here</b>"

Pretty much the same for italic and underline.

Now i have seen a form field somewhere that when you high-light the text and then press the B button and the text gets formatted.
I tried downloading a couple of the text editers from flashcomponents.net but i am still none the wiser.

Anyone know how i can do this

Cheers
Paul

Form Field Text Formatting Help
Hi guys i made a post about this today but didnt get anywhere. i have since got a bit further but still running into problems. i have attached an fla So you can see the problem. I seem to be losing the focus once i press one of the format buttons.
This is not my code more a selection of posts that i have read up on this subject.

code:
myTextFormat = new TextFormat();
myTextFormat.bold = false;
myTextFormat.italic = false;
myTextFormat.underline = false;

//
textToEdit = msgfield;
Selection.setFocus(textToEdit);
//
function selectText() {
selectedText = Selection.getFocus();
//
trace("textfield path= "+textToEdit);
trace("current select= "+selectedText);
//
if (selectedText == textToEdit) {// Cant seem to get behound here
begin = Selection.getBeginIndex();
end = Selection.getEndIndex();
cursor = Selection.getCaretIndex();
currentFormat = textToEdit.getTextFormat(begin, end);
}
}
//Bold button
b_bold.onRelease = function() {
Selection.setFocus(textToEdit);
Selection.setSelection(begin, end);
myTextFormat = currentFormat;
if (b_bold._currentframe == 1) {
b_bold.gotoAndStop(2);
myTextFormat.bold = true;
textToEdit.setTextFormat(begin, end, myTextFormat);
} else {
b_bold.gotoAndStop(1);
myTextFormat.bold = false;
textToEdit.setTextFormat(begin, end, myTextFormat);
}
};
// Italic button
b_ital.onRelease = function() {
Selection.setFocus(textToEdit);
Selection.setSelection(begin, end);
myTextFormat = currentFormat;
if (b_ital._currentframe == 1) {
b_ital.gotoAndStop(2);
myTextFormat.italic = true;
textToEdit.setTextFormat(begin, end, myTextFormat);
} else {
b_ital.gotoAndStop(1);
myTextFormat.italic = false;
textToEdit.setTextFormat(begin, end, myTextFormat);
}
};
//Underline button
b_und.onRelease = function() {
Selection.setFocus(textToEdit);
Selection.setSelection(begin, end);
myTextFormat = currentFormat;
if (b_und._currentframe == 1) {
b_und.gotoAndStop(2);
myTextFormat.underline = true;
textToEdit.setTextFormat(begin, end, myTextFormat);
} else {
b_und.gotoAndStop(1);
myTextFormat.underline = false;
textToEdit.setTextFormat(begin, end, myTextFormat);
}
};
stop();


Function selectText()

code:
onClipEvent (mouseUp) {
_parent.selectText();
}


Cheers
Paul

Form Field Text Formatting Help
hello guys and a happy new year

I have once again started tinkering about with another part of my site. the form fields for contact, postnew(forum), postMsg(siteinbox) I am trying to take away the basic formatting sys i have

ActionScript Code:
//Bold but
msgfield.text+=msg+" <b>type bold text here</b>"

Pretty much the same for italic and underline.

Now i have seen a form field somewhere that when you high-light the text and then press the B button and the text gets formatted.
I tried downloading a couple of the text editers from flashcomponents.net but i am still none the wiser.

Anyone no how i can do this

Cheers
Paul

Hide Script In Form Text Field
Hey guys. I really need some help. I just completed a flash form that allows a user to enter their name email and comments and submit... then sending it to my email address. It works, however, in the text fields, I can see scripts... like _level0.FirstName kinda thing. If I delete the instance name or variable name, the form stops working. Any suggestions? If you want to see what I am talking about, go to http://www.dangerousmedia.com/projec...d/dmflash.html and click on the telephone to see the form. Thanks.

Linking Form Field To Dynamic Text Box?
Hi,

I was wondering if it's possible to link a form field to a dynamic textbox in such a way so that when text is entered into the form field, it shows in the dynamic text box? I need it to handle backspace as well as just highlighting the chars and deleting them from the form field as well.

Send A Text Field With The Mail Form?
I only need to know how i can add to a mail form that i have a > text field < called "order" that have a list of products that the user select in the page.

So when the form sends the user information, sends the text field to...

I need to know if this is posible or not -

sorry for keep posting the same question, but i cant find this anywhere!!

Flash Form Field: Select Text On Click
Hey All,

I have a flash form, prepopulated with form box titles. Client would like the text to highlight on first click rather than the defualt double click. Any ideas on the approach here? Listener Object? Script?

Any help would be fantastic!
Cheers
-jub-

Form Field To Check Length Of Input Text
i'm trying to get a Flash form to test certain conditions, one of which is the full date (ie 2006 as opposed to 06), but the AS below (in bold) isn't working... does anybody know the right script?


on (release) {
if (!name.length) {
text.emailstatus = "please enter your name";
} else if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
text.emailstatus = "please enter a valid email";
} else if (!message.length) {
text.emailstatus = "please enter your message";
} else if (!year.length < 4) {
text.emailstatus = "please enter the full year";
} else {
loadVariablesNum("MailPHP.php", "0", "POST");
text.emailstatus = "message sent - thankyou";
}
}

FLASH MX Form, Tab Index, Move To Next Text Field
I am pretty new to flash, especially with the action script side. But here is what I am trying to do.

I a have a fairly simple form, what I want to have happen, is when a user enters a value in a text field, automatically move to the next text field.

Secondly, when pressing the tab key, move to a specific text field, or rather, follow a specific tab order.

It sounds odd but the flash form is a version of a paper form which has to be scanned for OCR after it is printed. So where a user enters in a last name, it is actually a series of one character text fields. This ensures that the text lines up exactly as the OCR expects to see it. Making it a multi character text field will not allow the text to line up so I am fairly certain I have to do it this way. When the user enters the first letter of the last name, it will automatically advance to the second letter box for the last name and so on until the last field is reached. If at any time the user hits tab, I want them to be taken to the first name section, which is just like the last name, a series of one character text boxes.

Does this make sense, it is possible, ikmpossible or really hard to do?

Thanks
Doug

Setting Focus To First Text Field In Flash Form
I have some text fields and when the movie is exported or loaded I need the
cursor to be focused to the first textfield in the form

Please Reply soon Its urgent

Thank U,
S. Rajasingh Samuel

Including Dynamic Text Field In Form Results
How do I include the dynamic text box data in a form? The text boxes are filled out using external txt files.... Thanks

Form Field Styling (Input Text Formatting)
Is there a way to format multiple form fields (input text) at the same time? For instance, I have a form with 10 input text fields and I want all of them to have black borders and gray backgrounds. To do this, I've coded one as:
txtInput1.border = true;
txtInput1.borderColor = 0x000000;
txtInput1.background = true;
txtInput1.backgroundColor = 0xCCCCCC;

Is there a way for me to create a sort of "style" that I could apply all of these values to a text input easily, the way TextFormat can apply text styles?

How To Hide A Input Text Field In A Login Form.
First of all let me state i'm kind of new to AS3.

I'm making a login form, and i've managed to make it work, but when the form actually moves frames, both the user_field, and password_field, remains visible...

What am I missing to make those fields disappear?.

Here is my code.

Elliot J. Balanza



thanks.







Attach Code

var usuario:String;
var contrasena:String;

bLogin.addEventListener(MouseEvent.CLICK, procesaLogin);

function procesaLogin(event:MouseEvent):void
{
addChild(user_field);
addChild(password_field);
usuario = user_field.text;
contrasena = password_field.text;
if(usuario == 'Elliot')
{
if(contrasena == 'elliot')
{
gotoAndStop('Home','Contenido');
}
else
{
gotoAndStop('Retry');
}
}
else
{
gotoAndStop('Retry');
}
}

Creating Form In AS3...Can't Assign Var Name To Dynamic Text Field?
In AS2 I would simply add a var name to a input text field from the property panel but when I try to do so in AS3 it's not supported. How do I assign a var name to input text using ActionScript 3? If anyone can answer this for me and/or point me to a thread/tutorial on creating an email form in AS3 I would greatly appreciate it.

Hidden Form Field/email Form Field
does anyone know how to create hidden form field in flash or even help with an email input form ?

Hidden Form Field/email Form Field
does anyone know how to create hidden form field in flash or even help with an email input form ?

Hide Action Script In Text Field Of Flash Form
Hey guys. I really need some help. I just completed a flash form that allows a user to enter their name email and comments and submit... then sending it to my email address. It works, however, in the text fields, I can see scripts... like _level0.FirstName kinda thing. If I delete the instance name or variable name, the form stops working. Any suggestions? If you want to see what I am talking about, go to http://www.dangerousmedia.com/projec...d/dmflash.html and click on the telephone to see the form. Thanks.

Auto Submit From Flash Form Cfinput Text Field
I have a Flash Form in ColdFusion 8 that consist of a CFInput Text field, and a CFGrid. When the user scans a barcode, I want the form to validate that there is a value, then submit the form (without using a submit button).

Since I'm still a newbie at ActionScript 3.0, I was hoping someone could shed some insite. Should I use the onBlur action in the cfinput tag? What actionscript commands do I need to force a submit?

Populating Dynamic Text Field With Form Data From Previous Frame
I've got a dynamic text field (name) and I'd like to populate it with the values from two fields in a form from a previous frame. Does anyone know how to transport user-input values from one frame to another frame?

Here's the code I'm using to capture the user-entered data:

var submitListener:Object = new Object();
submitListener.click = function(evt:Object) {
var result_lv:LoadVars = new LoadVars();
result_lv.onLoad = function(success:Boolean) {
if (success) {
result_ta.text = "Thank you for completing this training module.";
} else {
result_ta.text = "Error connecting to server.";
}
};
var send_lv:LoadVars = new LoadVars();
send_lv.fname = fname.text;
send_lv.lname = lname.text;
send_lv.email = email.text;
send_lv.sendAndLoad("

Validate Text
How can i a validate a text box, so that if the (instancename.txt = 0) { then it would = to false;
else ; true

So what im triyn to do is validate the text box, so that it has some text or values in it otherwise an error would show up, if no tedxt is enter in the txt box

Validate Text Box
Hi

Can anyone tell me how to do a textbox validation?
Does FlashMX support regular expression?

Kindly provide sample source code......

your help is greatly appreciated......

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

Validate Text Upon Focus Out
I am trying to set up a function to validate a text input box to validate text upon leaving the text input box. I can get it to validate upon a change event but the focusOut doesn't work. Also, I am trying to change the color of the border to red and can get this with some success but still have some problems with the code. The addEventListener code is in a seperate function which is called when the application loads and anytime after when it is needed. Right now I am having an issue with not being able to get the object name or text values so it doesn't work at all like it should.







Attach Code

tiRetroMake.addEventListener("change", fValidateTextInput);
tiRetroSerial.addEventListener("change", fValidateTextInput);
tiRetroDesc.addEventListener("change", fValidateTextInput);

function fValidateTextInput()
{
if ((myText.length < 0 || myText.indexOf("'") != -1 || myText.indexOf("/") != -1 || myText.indexOf("\") != -1 || myText.indexOf("<") != -1 || myText.indexOf(">") != -1 || myText.indexOf("&") != -1 || myText.indexOf("?") != -1 || myText.indexOf("@") != -1))
{
Alert.show("' \ / < > & ? @
"+Locale.loadString("IDS_NOT_ALLOWED"));
myObject.setFocus();
ApplyTextboxInvalidStyle(myObject,false);
trace("stmt is false");
}
else
{
ApplyTextboxInvalidStyle(myObject,true);
trace("stmt is true");
}
trace("It now contains: "+myText);
}
// function fValidateTextInput
function ApplyTextboxInvalidStyle(textbox,invalid)
{
if (invalid)
{
textbox.setStyle("borderColor", 0xff0000);
textbox.setStyle("borderStyle", "solid");
}
else
{
textbox.setStyle("borderColor", 0xD5DDDD);
textbox.setStyle("borderStyle", "solid");
}
}

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

Validate Text Fields Within Movie Clip
I have a simple login form that accesses a db to check if user exists. Now i want to add validation to the username and password text fileds, i have constructed the below actionscript code and it does not work. I think i need to add code to this so it knows that it has to validate the fields within my movie clip.

Can this be done?

on (release) {
if (VUSERNAME eq "") {
output = "Please enter your Username";
} else if (VPASSWORD eq "") {
output = "Please enter your Password";
} else {
root.mydata.loadVariables("login.php", "POST");
_root.mydata.gotoAndStop(2);
gotoAndStop (2);
}
}

Thanks

How To Validate The Text Message Correctly For Submitting It On To A New Screen
I have validated a text filed, so that you can't enter more then 10 words but if i submit it on to the new screen the validation doens't start to work proplery, it still don't send the text on to a new screen.

Send Email From "input Text Field" Or Form...HElp
I'm trying to figure out how to send email without launching a
composition window (from an email client). I've gone through some
tech notes on macromedia.com, but can't find what I'm looking for!
I have an "input text field" and "send" button. I want the user to be able
to enter their email address and click the button to send the info without
launching another window or app. I know it's probably a Variable thing...
I've tried and can't get it to work. Any ideas would be really appreciated.
Thanx!
[Edited by dsprouls on 08-09-2001 at 03:13 AM]

Get A Text Field To Mirror The Contents Of Another Text Field [renamed]
hi guys. When i type the numbers in the box A.i want the number also appears in box B without typiing it, how to do this? Hope to hear ur replies soon.

( This is my link to my to the picture )
http://download.yousendit.com/ADA616D00C698A56

Calculating Input Text Field To Dynamic Field (easy Action Script)
hi. i'm trying to learn action script and i need help with this bit. i'm trying to use action script to calculate my brothers ages based on my own.

using flash MX. i have an input field called "my_age" and two dynamic fields called "eli_age" and "jacob_age". eli is 4 years younger and jacob is 6 years younger. i want to be able to enter my age in the "my_age" input field and then click a button that will calculate their respective ages.

here's the fla if i haven't been clear.

thanks for any/all help,
josh

Getting A Text String Value From A Text Field And Duplicating It In Another Text Field
I'm trying to take the text from one text field and duplicate it in another.

I want to display the text that is in the text field _root.MC_Control.tab_title in another text field called _root,video_title.

I have tried this:

_root.video_title.text = _root.MC_Control.tab_title.text;

and this:

_root.video_title.text == _root.MC_Control.tab_title.text;

neither one seems work....am I missing something?

Getting MySQL Field Data Into Dynamic Text Field In Flash
Hi, im having some trouble as to how to retreive data from a mySQL database field and putting the values into a dynamic text field in Flash... im quite new to this so any help will be appreciated! thanks.

[FMX04] AS - Showing Text Field As HTML Field With XML/CDATA.
Hey all -

Trying to get a text field in my Flash MX movie to pull from and XML file with CDATA tags to show as HTML. I've checked the box to render as HTML for the text data field... but I'm having problems with the Actionscripting.

The field from this line is what I need to recognize as HTML reading CDATA tags:

this.ref["textField"+i].text = subnodes[3].firstChild.toString()

I know I need to do more than just change it to ".html" instead of ".text" and have tried a couple things, but nothing seems to work.

Any help greatly appreciated!


Code:
//Create the XML Object
myXML = new XML ();
myXML.load(newXml);
myXML.ignoreWhite = true;

//Load XML file
myXML.load("PBintro.xml");
//Make a reference to current timeline
myXML.ref = this
// Parse XML and fetch
myXML.onLoad = function(success){
if(success){
var root = this.firstChild ;
nodes = root.childNodes
for(var i=0; i<nodes.length; i++) {
this.ref["Title_txt"+i].text = nodes[i].attributes.name
subnodes = nodes[i].childNodes
this.ref["Comments_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i] = subnodes[1].firstChild.toString()
this.ref["holder_mc"+i].loadMovie(subnodes[2].firstChild.toString())
this.ref["textField"+i].text = subnodes[3].firstChild.toString()
this.ref["textField"+i] = subnodes[4].firstChild.toString()
}
} else trace("Error loading XML document")
}

Copyright © 2005-08 www.BigResource.com, All rights reserved