How do I post HTML form input tags name element array [ ] with Coldfusion?

  • Profile Image
    mindriot70
    Asked on June 13, 2011 at 02:05 AM

    The basic question is if I have multiple fields names that are identical in my form fields, how do I post the values from my thank you page so Coldfusion/Railo can read the [] array fields as a simple string so I can post to my external database?

  • Profile Image
    mindriot70
    Answered on June 13, 2011 at 02:13 AM

    After 2 days of coding I finally found out how to do this!

    <cfset PIFirst = form["Q1_PERSONALINFORMATION[first]"]>
    <cfset PILast = form["Q1_PERSONALINFORMATION[last]"]>
    <cfset BAAL1 = form["Q4_BUSINESSADDRESS[ADDR_LINE1]"]>
    <cfset BAAL2 = form["Q4_BUSINESSADDRESS[ADDR_LINE2]"]>
    <cfset BAC = form["Q4_BUSINESSADDRESS[CITY]"]>
    <cfset BACO = form["Q4_BUSINESSADDRESS[COUNTRY]"]>
    <cfset BAP = form["Q4_BUSINESSADDRESS[POSTAL]"]>
    <cfset BAS = form["Q4_BUSINESSADDRESS[STATE]"]>
    <cfset PNA = form["Q6_PHONENUMBER6[AREA]"]>
    <cfset PNP = form["Q6_PHONENUMBER6[PHONE]"]>
    <cfset CNA = form["Q5_CELLNUMBER[AREA]"]>
    <cfset CNP = form["Q5_CELLNUMBER[PHONE]"]>

    <!---Then insert into your database--->

    <cfquery name="myqueryname" datasource="mydatasource">
        INSERT INTO MyTable (Q1_PERSONALINFORMATIONFIRST, Q1_PERSONALINFORMATIONLAST, Q4_BUSINESSADDRESS_ADDR_LINE1,Q4_BUSINESSADDRESS_ADDR_LINE2,Q4_BUSINESSADDRESS_CITY,Q4_BUSINESSADDRESS_COUNTRY,Q4_BUSINESSADDRESS_POSTAL,Q4_BUSINESSADDRESS_STATE, Q6_PHONENUMBER6_AREA,Q6_PHONENUMBER6_PHONE, Q5_CELLNUMBER_AREA,Q5_CELLNUMBER_PHONE, )
         VALUES (
        #PIFirst#,
        #PILast#,
        #BAAL1#,
        #BAAL2#,
        #BAC#,
        #BACO#,
        #BAP#,
        #BAS#,
        #PNA#,
        #PNP#,
        #CNA#,
        #CNP#)
    </cfquery>

    Hope this helps any Coldfusion users!

  • Profile Image
    NeilVicente
    Answered on June 13, 2011 at 07:42 PM

    Hi,

    Glad to see that you were able to figure things out on your own. I personally apologize if I wasn't able to attend to your question the soonest time possible. I hate to admit but I do not know a single thing about coldfusion.

    Your solution though would be of great help to any Jotform user who might be needing to delve into Coldfusion language for their projects.

    We appreciate your efforts.


    Neil

  • Profile Image
    mindriot70
    Answered on June 13, 2011 at 08:04 PM
    No problemo! With this figured out I see a great partnership with some of
    our clients with you. Keep up the great work!

    Anthony

  • Profile Image
    dskillz1911
    Answered on July 14, 2012 at 02:51 PM

    Mindriot70,

    have you had any luck using coldfusion with the file upload feature JOTFORM has? If so I would love to see the code.

  • Profile Image
    Boris
    Answered on September 29, 2016 at 05:37 AM

    We're sorry for the spam email that the people subscribed to this support thread received today. We kindly recommend you do not click on any of the links that person provided.

    The spam post has been removed from the forum.

    Thank you.