Welcome to Dream.In.Code
Getting Help is Easy!

Join 118,309 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,688 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Dynamicly created text fields and getting them into a db

 
Reply to this topicStart new topic

Dynamicly created text fields and getting them into a db, Not sure that is a good description

wblakenc
post 23 Jul, 2008 - 12:42 PM
Post #1


New D.I.C Head

*
Joined: 17 Jul, 2008
Posts: 6


My Contributions


Ok I am working on an online form where counties in my state can enter in data based on the number of precincts they have. I have it currently when the county logs on that CF populates a table and creates text input fields so the user can type in the data. The problem is, each county has a different number of precincts so how to i insert fields into a database if I do not know how many text fields their will be. The number varies greatly (some have 4 others have 198).

For example (what the county will see)

Precinct 1 - [text input field 1]
Precinct 2 - [text input field 2]

[...]

Precinct x - [text input field x]


Like I said I already have the precincts stored in a database and when the form is generated by CF it puts the precinct names into the form for the county. But how do I save the user input?

I was thinking of putting the text input into an array using javascript, but I do not know how to loop through all the text fields easily.

Currently here is my code:

CODE


<table>
<cfinput type="text" name="modemNums" value="#popModem.recordCount#">
<cfoutput query="popModem">
<tr>
<td><cfinput type="text" name="precinct#popModem.currentRow#" value="#precinct#" readonly="true"></td><td><cfinput type="text" name="phone#popModem.currentRow#"></td>
</tr>
</cfoutput>
</table>


Ideas?!?
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/10/08 11:42AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month