• Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamically created html textboxes in Java  RSS feed

 
john krem
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this code, which is creating textboxes based on the number of selections of items by a user.



This is working fine, but I'm wondering how I can name these text boxes so that I can have access to them and get the input values of the different textboxes individually?

I did have


but it named every textbox the same.
Is there some way I can accomplish this?

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

think I got it.
 
Ralph Cook
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Congratulations.

Sometimes explaining your problem, logically and in detail, can lead you to a solution. Lots of times, in fact.

rc
 
john krem
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ralph Cook wrote:Congratulations.

Sometimes explaining your problem, logically and in detail, can lead you to a solution. Lots of times, in fact.

rc


That's something that I am really starting see!

I've implemented a sweet little spinner instead of the textboxes now though as it's just a quantity box for the number of orders, so it's looking pretty good. A few more things to figure out, but good progress for today.
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
?
You'll get fields like txtBox0, txtBox1, etc.
 
john krem
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:?
You'll get fields like txtBox0, txtBox1, etc.


yeah, exactly.

i've changed it up though and have found a 'spinner' that I'm using, and when I do that to the name, the buttons on the spinner stop working.

If there is a better way, please let me know!

What I want to do is also dynamically populate the name so I can access the individual values of each spinner.

When I change the code so the name does as I am hoping


The buttons on the spinners stop working. When I remove that +i+ stuff and just have this:


the buttons work fine. Can anyone explain how/why a change in the name would affect the buttons functionality?

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!