Solved

Clearing a form

Posted on 2006-06-25
3
204 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
  • 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
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).

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