Solved

Reset button not responding, refresh doesn't clear inputs

Posted on 2004-04-18
3
696 Views
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%>
<br>
<font color=red><b><center>Required fields *</center></b></font>
<table border="0" width="90%" cellpadding="5" align=center>
<br>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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. name@domain.com</font> </td>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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. name@domain.com</font></td>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<td align="center" colspan="2"><font color=red><b>Please, make sure that the data entered is correct</b></font>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>            
</table>
<center>
<input type="button" name="submitForm" value="Save Details" onClick="validate(this.form)">
<input type="button" name="reset" value="Reset">
</center>                        
</form>
            
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.
0
Comment
Question by:anna_suchodolska
  • 2
3 Comments
 
LVL 92

Expert Comment

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

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

Author Comment

by:anna_suchodolska
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?
0
 
LVL 92

Accepted Solution

by:
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?
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
We have come a long way with backup and data protection — from backing up to floppies, external drives, CDs, Blu-ray, flash drives, SSD drives, and now to the cloud.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now