Helpful Information
 
 
Category: ColdFusion
Find count of textboxes

If I have text fields dynamically created on a page via JavaScript, and they are named along the lines of "textbox1", "textbox2", "textbox3", etc, and there is no limit to how many extra textboxes the user can add, how would you find how many textboxes were displayed on the previous page once you get to your form submission page?

I want to use a loop to draw out the textbox contents and save to the database, but without knowing how many textboxes there were I am unable to do this.

Can anyone please help? Thanks :)

If I have text fields dynamically created on a page via JavaScript, and they are named along the lines of "textbox1", "textbox2", "textbox3", etc, and there is no limit to how many extra textboxes the user can add, how would you find how many textboxes were displayed on the previous page once you get to your form submission page?

why not update a hidden form element with the number of textboxes that are added through javascript...later on the server-side u can use this count to loop through the textboxes

Hi, thanks yes that is an idea, but could you please inform me as to how? I know how hidden fields work, but not sure how to create it based on my dynamically created text fields.

I made a post in the JavaScript forum about my first problem, solved it, and my post here is my now problem as an after affect of that first problem. If it helps to see what code I am talking about and how it might apply here, please go here:

http://www.codingforums.com/showthread.php?t=131077

Your thoughts would be greatly appreciated. Thanks!!

never mind, figured it out :)










privacy (GDPR)