aspose file tools*
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
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: why submit the form when enter the text field-- Pls Help