PDA

View Full Version : Creating a FORM with unique reference number.


redhot27
06-02-2010, 11:01 AM
I need to create the following: a 'form' that

1- has a unique reference number for every submission
2- has one field that is pre-populated with a value from a choice in a combobox
3- has a 'print function once the form has been filled in
4- can be 'submitted' via email once checked (including the ref. number)

Basic Flow is:
User browses various categories of product and makes selection in combobox. (This value is obtained by else/if and then outputs a value)

Upon clicking 'accept' that value must then be pushed to a field in the 'form'.
The form must open with a unique reference number- (random or sequential doesn't matter)

The entire form must then be filled out and 'printed'. Upon validation, then info must then be submitted to another party via email.

Any help with this process will be greatly appreciated- I'm not even sure this is the best way to do this, or whether it'll be simpler to use (php, jquery etc.)
Basically I'm looking for insight into best completing this.

REALLY grateful for any help. Thx.

ASWC
06-02-2010, 01:29 PM
the way I do this is by working with a database and get the unique id (reference number) from it.

redhot27
06-02-2010, 02:00 PM
Thanks for your response- that is just one of the ways of implementing this I reckon- the other would be to use the math function (random etc) and output it to a dynamic field on the stage.

I've created the whole application- to give you an idea: it has about 12 categories- those twelve categories together contain a total of about 500 options, all with unique 'prices' that are called in the AS by IF getValue = 1 ELSE IF getValue = 2 ,etc etc.

Questions

Q:How to implement the AS that 'gets' the value from that combobox in the previous step?
Q: The print screen function- how to write script for a button that will allow me to print the filled form?
Q: How to then send all this via email (formatted text or HTML preferably)

Thanks again.

ASWC
06-02-2010, 02:11 PM
combobox are really easy to work with once you understand how they work. Each field in a combobox has a label value which is a string and a data value which is an object. The data value is the one of interest since you can pass in it pretty much all you want even the corresponding price of the item and of course even full objects. That's why I never need an if else when working with combobox. I get back the selected item and use directly all info I stored in its data value.

printing is quite easy I recommend to check the docs where you'll find plenty of examples.

build your html directly in your Flash application and then send this to a server side script which will send the email. To display this email with formatted html you might need to adjust the headers of the email. Check the docs of the server side script you use to see how to change the headers.

redhot27
06-02-2010, 02:19 PM
Thanks again- its quite interesting -the part about being able to pass all info in the data value... thanks for your help.

Still quite lost though but the picture is coming together slowly;)