Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    Quote Originally Posted by rubo18 View Post
    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
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #3
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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:

    Help with Validation on Dynamically Created Text Field

    Your thoughts would be greatly appreciated. Thanks!!

  • #4
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    never mind, figured it out


  •  

    Posting Permissions

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