• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic