Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Reset button not responding, refresh doesn't clear inputs

Posted on 2004-04-18
3
Medium Priority
?
769 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 60 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Did you know there are services out there that can turn an Instagram feed into an RSS feed? I found some interesting exclusive Instagram content which I wanted to follow without signing up for yet another social media account. RSS to the rescue!
Your business may be under attack from a silent enemy that is hard to detect. It works stealthily in the shadows to access and exploit your critical business information, sensitive confidential data and intellectual property, for commercial gain. T…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

916 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