Solved

Clearing a form

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
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…

789 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