Solved

Clearing a form

Posted on 2006-06-25
3
182 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
Comment Utility
<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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now