my dog learned polymorphism*
The moose likes Struts and the fly likes I need to enter some value in JSP text field and then need to press enter which should fetch data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "I need to enter some value in JSP text field and then need to press enter which should fetch data" Watch "I need to enter some value in JSP text field and then need to press enter which should fetch data" New topic
Author

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

Bala Ranch
Greenhorn

Joined: Jul 29, 2008
Posts: 9
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

Joined: Sep 29, 2008
Posts: 12617

Why wouldn't you just use a form?
Bala Ranch
Greenhorn

Joined: Jul 29, 2008
Posts: 9
Hi David,

Can you elaborate on how to use form to invoke the Text Box event.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Jan 28, 2008
Posts: 5575

welcome to javaranch Bala
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Oh, you mean you want to replace the value in the textbox with the results of an Ajax request?
Bala Ranch
Greenhorn

Joined: Jul 29, 2008
Posts: 9

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.
 
Don't get me started about those stupid light bulbs.
 
subject: I need to enter some value in JSP text field and then need to press enter which should fetch data
 
Similar Threads
Inconsistent focus on input field
how to iterate.
Fixed Table Header and changing classes
How to retrieve the values of dynamically created text boxes in jsp
dynamic text box value into database