Solved

Reset button not responding, refresh doesn't clear inputs

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

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
HTML5 vs JSP - REST based application development 4 1,208
runtime exception and error differences 4 84
countXY challenge 28 160
runtime exception 2 42
ConnectWise and their customers need to ensure critical alerts automatically reach the right person at the right time. MSP superheros efficiently respond to these alerts key is providing automatic, intelligent alerting that generates a complete audi…
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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