A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: [F8] Using Text Input for other fields

  1. #1
    Junior Member
    Join Date
    Nov 2008
    Posts
    15

    [F8] Using Text Input for other fields

    I've created a form that invites a user to input their name, email, phone, postal address. When they click the submit button, the data is sent to a php file and emailed to a recipient, while the form rolls over to a confirmation page, providing feedback to the user that the form was submitted successfully.

    So far so good, this all works

    What I would like to do is customise the confirmation page with the users inputed data. How do I have the input text of one field appear as static text in the next frame?

  2. #2
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Why have it as static text? Why not have a dynamic text field(s) carry over the info to the confirmation page?
    Wile E. Coyote - "Clear as mud?"

  3. #3
    Junior Member
    Join Date
    Nov 2008
    Posts
    15
    On the first page, I'm using "Input Text" fields to gather the required information. How do I output this as either static or dynamic text on the confirmation page? I just created a blank dynamic text field and used the same instance name as the input text field but the inputed data did not carry over to the confirmationn page. What am I missing here?

  4. #4
    Junior Member
    Join Date
    Nov 2008
    Posts
    15

    Script

    Here is the script I'm using on the main timeline:

    Code:
    stop ();
    submit.onRelease = function () {
    	myForm.fromName = Name.text;
    	myForm.fromEmail = Email.text;
    	myForm.fromPhone = Phone.text;
    	myForm.submitForm ();
    	_root.outName.text = [_root.Name.text];
    };
    
    myForm.onSubmit = function () {
    	gotoAndStop (2);
    };
    The myForm statements send various inputed data to a php file for emailing. The _root statement was me testing an idea to take data inputed into the Name Var and output it in the second frame where I have a dynamic text box called outName. The form seems to work but the desired outputed text for Name does not appear. Am I even on the right track here?

    Thanks for the help folks.

  5. #5
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Sorry... did it a bit different... but none the less it works. Basically all I did was create an Array pass the variables into the array and then had the dynamic text fields on the confirmation page equate to the specific index. See example. Cheers!
    Last edited by Robb@exo; 03-01-2010 at 11:41 AM.
    Wile E. Coyote - "Clear as mud?"

  6. #6
    Junior Member
    Join Date
    Nov 2008
    Posts
    15

    Resolved

    Hey Robb@exo, thanks for your help. Unfortunately I couldn't open the fla you posted - unexpected file format error (I'm using Flash 8).

    Anyways, I think I've resolved the problem. In the main time line I've included the line:

    Code:
    name = Name.text;
    Then on the confirmation page I included:

    Code:
    outName.text = name;
    This takes the input text from "Name" on the first page and outputs it to a dynamic text field "outName" on the confirmation page. So far this is working and I will try adding additional fields if I find time later today.

    If it's possible, I'd appreciate you re-sending your fla file. I'm still interested in seeing what you've done.

    Thanks.

  7. #7
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Let me know if the file doesn't work for you. The last one was a CS4 file with AS2. This one is Ver8 AS2.
    Last edited by Robb@exo; 03-01-2010 at 11:41 AM.
    Wile E. Coyote - "Clear as mud?"

  8. #8
    Junior Member
    Join Date
    Nov 2008
    Posts
    15
    Hey Robb@exo, thanks for the file. I like the way the array works and it seems quite straight forward to implement. I'm actually working on another project at the moment and I'll probably end up using this method. Thanks again.

  9. #9
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Your welcome, glad I could help.
    Wile E. Coyote - "Clear as mud?"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center