Skip to main content
Known Participant
June 18, 2009
Question

How to create a simple flash form?

  • June 18, 2009
  • 1 reply
  • 1558 views

Hey all,

Okay, I've decided to create a simple form using the <cfform format="flash">.

I would like visitors to my site to be able to leave a comment on the articles they read. Specifically, the form needs to grab the text from my <cftextarea> as well as a few other variables e.g. userID, articleID. I'm not sure if Flash forms can do this but I'd like my user to be able to hit the submit button and not leave the article.

I know there is some debate about this but I'd like to send my information to a cfc e.g. submit.cfc. The submit.cfc will save the information into my db.

I've been unsuccessful at finding a simple tutorial on how to accomplish this. I'm hoping one of you might be able to a) point me in the right direction or b) provide me with a simple description of the steps involved.

Thanks so much.

    This topic has been closed for replies.

    1 reply

    Dileep_NR
    Inspiring
    June 19, 2009

    Hi,

    Please try the following,

    <cfform name="myform"  format="Flash" action="test.cfm" method="post">
                    <cfformgroup type="horizontal">
                        <cfformgroup type="vertical" width="330">
                            <cfformgroup type="horizontal">
                                <cfformitem type="text" width="122">First Name</cfformitem>
                                <cfinput type="text" name="str_firstName" width="160" style="color:##006090"  required="yes"  message="You must enter First Name" maxlength="50" tabindex="0"/>
                            </cfformgroup>                   
                            <cfformgroup type="horizontal">
                                <cfformitem type="text" width="122">Permanent Address</cfformitem>
                                <cftextarea type="text" name="str_permanentaddress" width="160" height="50" required="yes" message="You must enter Your Permanent Address"  maxlength="200" tabindex="2"></cftextarea>
                            </cfformgroup>                       
                            <cfformgroup type="horizontal" >
                                <cfformitem type="text" width="122">Primary Email</cfformitem>
                                <cfinput type="text"  name="str_primaryemail"  width="160"  style="color:##006090" required="yes" message="You must enter Your Primary Email"  maxlength="50" tabindex="4"/>
                            </cfformgroup>
                            <cfformgroup type="horizontal" >
                                <cfformitem type="text" width="122">Contact Phone</cfformitem>
                                <cfinput type="text"  name="str_contactphone"  width="160"  style="color:##006090" required="yes" message="You must enter Contact Phone"  maxlength="20" tabindex="6"/>
                             </cfformgroup>
                            <cfformgroup type="horizontal" >                   
                                <cfformitem type="text" width="122">Cell Phone</cfformitem>
                                <cfinput type="text"  name="str_cellphone" width="160"  style="color:##006090"  maxlength="20" tabindex="8"/>
                            </cfformgroup>
                           
                            <cfformgroup type="horizontal" >   
                                <cfformitem type="text" width="122">Gender</cfformitem>
                                <cfselect name="str_Gender" width="100" tabindex="12">
                                    <option value="M">Male</option>
                                    <option value="F">Female</option>
                                </cfselect>
                            </cfformgroup>
                           
                        </cfformgroup>
            </cfformgroup>   
    </cfform>

    Known Participant
    June 19, 2009

    Thanks catchme_dileep,

    I also took a look at your other reply to my first question. I'm guessing your responses are supposed to work together e.g. send form info to a submit.cfm that drops the data into my db, and then add <cflocation> to get back to my form?

    I was hoping to use cfc's instead but it doesn't seem like anyone likes this approach. I wonder why?

    In any case, thank you for sharing your knowledge. I really do appreciate it.