Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
    Bookmark Topic Watch Topic
  • New Topic

advice need - howto make this effect ?

 
Nakata kokuyo
Ranch Hand
Posts: 467
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi, good day , assume i have 3 textfields in jsp,

when user key in data into first textfield , and the remaining second and third textfield automatically display out the value based on first textfield 's data , the display data in 2nd, 3rd textfield's data are query from DB and first textfield belong to primary key

thank in advance for your guidance ...thank you
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Nakata,
So you need to go to the database after the first field is entered. I recommend graying out the second and third until they are filled in to avoid confusion.
 
Ola Daniel
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Report post to moderator
Or you could have the values that are going to fill in the textfields in the scope of the page(request object most likely) in a vector and iterate through the vector based on the entry in the first textfield, I would suggest using a drop down menu instead of a textfield, that way you can streamline entries made in to the first field.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
There are several ways that you can do this.

One would be to use AJAX to make a call to the server when the first field is selected or filled out.

Another is to submit whole form after the first field is filled out, query the database, and redraw the whole page with the results. I have an example app that does this on http://simple.souther.us/not-so-simple.html. Look for DynamicSelectLists.

All of this assumes a strong knowledge of JSP/Servlets and web programming in general.
 
Nakata kokuyo
Ranch Hand
Posts: 467
  • Mark post as helpful
  • send pies
  • Report post to moderator
thanks for warm input , i try the sample of Ben Souther , thanks for your hardwork
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Nakata, please don't spread the same question across multiple topics. Since you have recived an answer in the new topic you opened in the HTML forum, I'm going to close this one.

In the future, please confine the discussion of a single question to a single topic.
 
    Bookmark Topic Watch Topic
  • New Topic