Solved

Clearing a form

Posted on 2006-06-25
3
225 Views
Last Modified: 2010-04-09
I have an online I use and is very large and send  alot of information by email.

When some one make a mistake or needs to change a certain part of the form and would like to clear the form of everything exceept certain parts of the form, like Name, address and so on.

Is there a way that if I place a clear bottom that it would only clear certain areas?
0
Comment
Question by:starview
[X]
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
3 Comments
 
LVL 30

Expert Comment

by:callrs
ID: 16978968
<html>
<head>
<script type="text/javascript">

function Validate(Form){
alert(Form.I1.value);
Form.I1.value=""
return false;  // to not submit
// return true // to submit
}
</script>
</head>
<form id=F1 action="#" method="POST" onsubmit='return Validate(this)'>
<input id=I1>
<input id=I2>
<input type=submit>
</form>
</html>
0
 

Author Comment

by:starview
ID: 16979095
I guess I am not really folllowing you on this.

Will this only clear certain areas of the form? So they can be re-entered.

Please explain
0
 
LVL 30

Accepted Solution

by:
callrs earned 500 total points
ID: 16979113
Yes. Dont try to analyze the example yet. First run it. (copy & paste into notepad, save as C:\temp\formtest.htm, then open it in your browser by typing c:\temp\formtest.htm in the address bar)

It will clear the field named "I1", but you can use the function to clear ANY field using the syntax I've given
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Find out what you should include to make the best professional email signature for your organization.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

691 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