Number of Children to Register: #numberOfChildren#
FirstName#i#
LastName#i#
Email#i#
Address#i#
Phone#i#

[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => mxstu [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> Using Coldfusion to Dynamically create Forms onanother page. - Coldfusion - Advanced Techniques

Using Coldfusion to Dynamically create Forms onanother page. - Coldfusion - Advanced Techniques

.... <!--- some variable containing the number of children ---> <cfset numberOfChildren = 2> <cfoutput> Number of Children to Register: #numberOfChildren# <form action="yourActionPage.cfm" method="post"> <table> <cfloop from="1" to="#numberOfChildren#" index="i"> <tr> <td>FirstName#i#</td> <td><input type="text" name="firstName#i#"></td> </tr> <tr> <td>LastName#i#</td> <td><input type="text" name="lastName#i#"></td> </tr> <tr> <td>Email#i#</td> <td><input type="text" name="email#i#"></td> </tr> <tr> <td>Address#i#</td> <td><input type="text" name="address#i#"></td> </tr> <tr> <td>Phone#i#</td> <td><input type="text" name="phone#i#"></td> </tr> <!--- other fields.... ----> </tr> <tr> <td colspan="2"><hr></td> </tr> </cfloop> </table> </form> </cfoutput>...

  1. #1

    Default Re: Using Coldfusion to Dynamically create Forms onanother page.

    ....

    <!--- some variable containing the number of children --->
    <cfset numberOfChildren = 2>

    <cfoutput>
    Number of Children to Register: #numberOfChildren#
    <form action="yourActionPage.cfm" method="post">
    <table>
    <cfloop from="1" to="#numberOfChildren#" index="i">
    <tr>
    <td>FirstName#i#</td>
    <td><input type="text" name="firstName#i#"></td>
    </tr>
    <tr>
    <td>LastName#i#</td>
    <td><input type="text" name="lastName#i#"></td>
    </tr>
    <tr>
    <td>Email#i#</td>
    <td><input type="text" name="email#i#"></td>
    </tr>
    <tr>
    <td>Address#i#</td>
    <td><input type="text" name="address#i#"></td>
    </tr>
    <tr>
    <td>Phone#i#</td>
    <td><input type="text" name="phone#i#"></td>
    </tr>
    <!--- other fields.... ---->
    </tr>
    <tr>
    <td colspan="2"><hr></td>
    </tr>
    </cfloop>
    </table>
    </form>
    </cfoutput>

    mxstu Guest

  2. #2

    Default Re: Using Coldfusion to Dynamically create Forms onanother page.

    Thank You.

    I did not realize that cfoutput could output html form field too.
    erichci Guest

  3. #3

    Default Re: Using Coldfusion to Dynamically create Forms onanother page.

    Yes. Just note that the form fields are dynamically named:
    firstName1
    lastName1
    .... etc...
    firstName2
    lastName2
    .... etc...
    mxstu Guest

Similar Threads

  1. Can't edit a page because I'm already editing it onanother computer??
    By workhardbenice in forum Macromedia Contribute General Discussion
    Replies: 7
    Last Post: July 24th, 03:52 PM
  2. Dynamically Generated Forms
    By javatech in forum Macromedia Flash Data Integration
    Replies: 1
    Last Post: October 28th, 05:21 PM
  3. Dynamically set path in Forms when saving images
    By Ian Currie in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: October 25th, 09:03 AM
  4. Using Coldfusion to Dynamically create Forms on anotherpage.
    By erichci in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: June 28th, 08:55 PM
  5. Create a PHP Page Dynamically
    By Noyb in forum PHP Development
    Replies: 10
    Last Post: July 28th, 02:59 PM

Bookmarks

Posting Permissions

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