Solved

Reset button not responding, refresh doesn't clear inputs

Posted on 2004-04-18
3
710 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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