Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I need to enter some value in JSP text field and then need to press enter which should fetch data

 
Bala Ranch
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am facing a problem like when I enter some value in Text field and then i have to press Enter button then that
event should fetch the remaining data from the Database associated to that entered value.

<tr>
<th>Application No</th>
<td><html:text property="appno" onkeypress="getAppDetails()" /></td>
</tr>

How this event function is going to be called in action.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why wouldn't you just use a form?
 
Bala Ranch
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,

Can you elaborate on how to use form to invoke the Text Box event.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bala Ranch wrote: when I enter some value in Text field and then i have to press Enter button then that
event should fetch the remaining data from the Database associated to that entered value.


can you clarify this bit more ?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
welcome to javaranch Bala
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, you mean you want to replace the value in the textbox with the results of an Ajax request?
 
Bala Ranch
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i have diff requirement compared to normal action call
i need to enter some primary key value in JSP Text field and then i need to press enter button then that event should call the action class method from javascript.
so when i press enter button for that i wrote onkeypress event which is defined in Javascript in turn which should call action class method which has the functionality code to fetch the database .

One JSP with some text fields like ID and name.when i enter ID value and then enter key then it should fetch the associated values from the database without submit() action.

It's very urgent.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic