Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
jay lai
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic