• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Dynamically created html textboxes in Java

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22682
128
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
?
You'll get fields like txtBox0, txtBox1, etc.
 
john krem
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic