Reset button not responding, refresh doesn't clear inputs

Posted on 2004-04-18
Last Modified: 2008-03-04
Hi all,

I've got a problem with my jsp.
I've added some scripts and since then neither the reset button is not clearing the data from the form boxes nor rfresh button.

Can you tell me what's wrong?

<form name="tableform" action="/TaxiGlobe/servlet/SaveNewCustomerServlet" method="post"
onSubmit="return false;">

<hr width=90%>
<font color=red><b><center>Required fields *</center></b></font>
<table border="0" width="90%" cellpadding="5" align=center>
<td align="left" width="30%"><b>Company name</b></td>
<td align=top><input type="text" name="companyName" size="40"
      value="<jsp:getProperty name ="customer" property="companyName"/>">
                  <font color=red>*</font></td>
<td align="left"><b>Company address</b></td>
<td align=top><input type="text" name="companyAddress" size="60"
      value="<jsp:getProperty name ="customer" property="companyAddress"/>"
                                          onKeypress="if (event.keyCode==34 || event.keyCode==39) event.returnValue = false;">
                  <font color=red>* </font></td>
<td align="left"><b>Company phone number</b></td>
<td align=top><input type="text" name="companyPhoneNo" size="20"
      value="<jsp:getProperty name ="customer" property="companyPhoneNo"/>"
      onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;">
<font color=red>*</font></td>
<td align="left"><b>Company fax number</b></td>
<td align=top><input type="text" name="companyFaxNo" size="20"
      value="<jsp:getProperty name ="customer" property="companyFaxNo"/>"
      onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;">
<font color=red>*</font></td>
<td align="left" ><b>Main contact names</b></td>
<td align=top><input type="text" name="mainContactName" size="50"
      value="<jsp:getProperty name ="customer" property="mainContactName"/>">
<font color=red>*</font></td>
<td align="left"><b>Main contact email address</b></td>
<td align=top><input type="text" name="mainContactEmail" size="40"
      value="<jsp:getProperty name ="customer" property="mainContactEmail"/>">
      <font color=red>* eg.</font> </td>
<td align="left"><b>Main contact phone number</b></td>
<td align=top><input type="text" name="mainContactPhoneNo" size="20"
      value="<jsp:getProperty name ="customer" property="mainContactPhoneNo"/>"
      onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;">
<font color=red>*</font></td>
<td align="left"><b>Secondary contact names</b></td>
<td align=top><input type="text" name="secondaryContactName" size="50"
      value="<jsp:getProperty name ="customer" property="secondaryContactName"/>"></td>
<td align="left"><b>Secondary contact email address</b></td>
<td align=top><input type="text" name="secondaryContactEmail" size="40"
      value="<jsp:getProperty name ="customer" property="secondaryContactEmail"/>">
<font color=red> eg.</font></td>
<td align="left"><b>Secondary contact phone number</b></td>
<td align=top><input type="text" name="secondaryContactPhoneNo" size="20"
      value="<jsp:getProperty name ="customer" property="secondaryContactPhoneNo"/>"
onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"></td>
<td align="left"><b>Card number</b></td>
<td><input type="text" name="creditCardNumber" size="30"
          value="<jsp:getProperty name ="customer" property="creditCardNumber"/>"
onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;">
<font color=red>*</font></td>
<td align="left"><b>Expiation date</b></td>
<td><input type="text" name="creditCardExpirationDate"
      value="<jsp:getProperty name ="customer" property="creditCardExpirationDate"/>"
onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;">
<font color=red>* eg.(mm/yyyy)</font> </td>
<td align="left"><b>Card type</b></td>
<td><select name="creditCardType"
value="<jsp:getProperty name ="customer" property="creditCardType"/>">
      <option value="">
      <option value="Visa">Visa
                <option value="Mastercard">Mastercard
              <option value="American Express">American Express
              <option value="Switch">Switch
              </select><font color="red">*</font>
<td align="left"><b>Card holder name</b></td>
<td><input type="text" name="creditCardHolder" size="30"
value="<jsp:getProperty name ="customer" property="creditCardHolder"/>">
      <font color=red>*</font></td>
<td align="center" colspan="2"><font color=red><b>Please, make sure that the data entered is correct</b></font>
<input type="button" name="submitForm" value="Save Details" onClick="validate(this.form)">
<input type="button" name="reset" value="Reset">
There is a javascript in the head, which is working with onClick="validate(this.form)".
New script which may be causing a trouble is added to the text field and the form tag,

Can someone help me to decifer it?
Thank you in advance.
Question by:anna_suchodolska
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 92

Expert Comment

ID: 10855492
you need to use a reset type input:

<input type="reset" name="reset" value="Reset">

Author Comment

ID: 10858325
thanks, but it is still not working.

Can it something to do with a session?
Even when I close and open my application the last data is still there?
What can it be?
LVL 92

Accepted Solution

objects earned 20 total points
ID: 10864646
> the last data is still there?

Yes, you display data from the customer bean. Do you expect to see blank fields?

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Display current date,month,and year to JTextField 3 63
EJB MDB example 4 89
eclipse buid path vs tomcat lib path 10 37
by zero exception 10 69
Direct mail marketing is the act of mailing materials straight to prospective customers. This wide form of marketing is one of the oldest methods of communicating with a geographic based demographic. So is it useful in 2017 and beyond?
This article summaries thoughts and ideas from two years of sustained use. It provides good reasoning to make the jump to Windows 10.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the adminiā€¦

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question