This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes why submit the form when enter the text field-- Pls Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "why submit the form when enter the text field-- Pls Help" Watch "why submit the form when enter the text field-- Pls Help" New topic
Author

why submit the form when enter the text field-- Pls Help

jay lai
Ranch Hand

Joined: Apr 04, 2002
Posts: 180
I have a jsp, have several text field and other drop down list, and Prepopulated information from database
when I enter something into the text field, the page seems submit itself and all the value that **Pre-populated** is **LOST**.
Many thanks if someone can giving me some suggestion or i did something wrong
[CODE]
In jsp
<html:text property="contactName" />

In form bean
private String contactName;
public void setReceiptDate(String contactName)
{
this.contactName = contactName;
}

public String getContactName()
{
return contactName;
}

protected void doReset(ActionMapping mapping, HttpServletRequest request)
{
this.contactName= "";
}
jay lai
Ranch Hand

Joined: Apr 04, 2002
Posts: 180
Anyone have any idea? I really need some advise on this.

The scenario is this:
whenever i enter into a text fields, the form itself is submit

many thanks in advance
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The only thing I can think of that would cause a form to submit itself automatically when you enter text into a field is JavaScript. Are any of the javaScript events (onKeyDown, onChange, etc.) for the <html:text> tag coded? If so, take out this code.

If this doesn't solve it, please post your JSP file here and we'll see if we can help you figure out what's causing it.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why submit the form when enter the text field-- Pls Help
 
Similar Threads
upload file from jsp to spring controller
Submitting a form on pressing Enter key
* Welcome Richard Reese
Dynamic text fields gives java.lang.IndexOutOfBoundsException
JSP Forms Text box