473,725 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reset data

I have a text field that's pre-filled with data. Suppose the user edits it,
but decides he wants to reset the data back to the original pre-filled data,
how can I do that?

Jul 20 '05 #1
6 2186
Shabam wrote:
I have a text field that's pre-filled with data. Suppose the user edits it,
but decides he wants to reset the data back to the original pre-filled data,
how can I do that?


<input type="reset" value="Start Over" />
Thats what a reset button does :)
--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 20 '05 #2
Is there a way to do this by a link instead of a button?
"Randy Webb" <hi************ @aol.com> wrote in message
news:X7******** ************@co mcast.com...
Shabam wrote:
I have a text field that's pre-filled with data. Suppose the user edits it, but decides he wants to reset the data back to the original pre-filled data, how can I do that?


<input type="reset" value="Start Over" />
Thats what a reset button does :)
--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #3
One more thing, is it possible to reset just a subset of items within a form
instead of everything?

Jul 20 '05 #4
Shabam wrote:
"Randy Webb" <hi************ @aol.com> wrote in message
news:X7******** ************@co mcast.com...
Shabam wrote:

I have a text field that's pre-filled with data. Suppose the user
edits it, but decides he wants to reset the data back to the
original pre-filled data, how can I do that?


<input type="reset" value="Start Over" />
Thats what a reset button does :)

Is there a way to do this by a link instead of a button?


Read the FAQ with regards to top-posting.

<a href="" onclick="docume nt.forms['myForm'].reset();return false">Start
Over</a>

Or better, make your button appear as a link (which is a better solution).

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 20 '05 #5
Shabam wrote:
One more thing, is it possible to reset just a subset of items within a form
instead of everything?


Read the FAQ with regards to quoting what you are replying to.

And you are wanting to reset certain fields back to there defaults and
leave others alone?

Create an array that contains each fields original value when the page
is loaded along with its default state (if it has one). Then loop
through your form and set the .value or default state of the ones you
want to reset.

http://groups.google.com/groups?hl=e...ang.javascript

Is the c.l.j. archives on google, happy searching.

What you want to find is:

1) How to loop through the form elements.
2) How to determine there type/value.
3) How to create an array containing that data.
4) How to "reset" it to its default state.
Hint: That will involve determining its type, looking up its
default state, and then resetting it.

Radio Button, Checkbox, Select, Text Input(includes a textarea).

Hopefully you will find your research an enlightening experience.

If you get stumped, post back with a URL to your un-finished script for
more guidance.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 20 '05 #6
> And you are wanting to reset certain fields back to there defaults and
leave others alone?

Create an array that contains each fields original value when the page
is loaded along with its default state (if it has one). Then loop
through your form and set the .value or default state of the ones you
want to reset.

http://groups.google.com/groups?hl=e...ang.javascript
Is the c.l.j. archives on google, happy searching.

What you want to find is:

1) How to loop through the form elements.
2) How to determine there type/value.
3) How to create an array containing that data.
4) How to "reset" it to its default state.
Hint: That will involve determining its type, looking up its
default state, and then resetting it.

Radio Button, Checkbox, Select, Text Input(includes a textarea).

Hopefully you will find your research an enlightening experience.

If you get stumped, post back with a URL to your un-finished script for
more guidance.


Thanks for your help. Yes I'm trying to reset just fields back to its
original. I'll do a bit more research and play with it.

Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
30108
by: Ken | last post by:
How can I reset the initial form variables that are set with session statements when clicking on a button? I tried this but the function was not called: <?PHP function reset_form($none) { $_SESSION = array(); } ?> <form enctype="multipart/form-data" name="company_info" method="post" action="add_pic.php">
1
2463
by: Michael Hill | last post by:
This reset type in my input tag really is not resetting the values. <input type="reset" value=" Clear "> Follow me for a minute. I have 2 selects. When I have a select1 that has some kind of input in it and then submit the form I get data based on select1. I then press the "back" button.
6
8189
by: Ramachandran Subramanian | last post by:
I have a question regarding the db2 reset monitor. When I issue the command and do a get snapshot I see most of the counters are reset . How ever the Dynamic SQL snapshot section doesnt seem to get reset. Is there any way to reset that ? When do the buffers for the dynamic SQL get updated reset?
3
6047
by: Dave Girvitz | last post by:
I have a PropertyGrid (Windows Forms App) based component that uses TypeConverters to generate ranges of acceptable values for properties. The idea was that I could download the key/value pairs from a database and manipulate the TypeConverters dynamically. The property grid then displays the property with a drop down list. It does work when I open the application for the first time. If, however, I open the form and then open a second...
1
14362
by: NancyASAP | last post by:
Thought I'd share this since it took me a long time to get it working. Thanks to a bunch of contributers in Google Groups who shared javascript, etc. The question was: How can I put a reset button on my ASP.NET web page, and have an HTML reset button click clear 1) all validator text display and 2) validation summary display. Problem was clearing them and yet still leaving them working and visible if the user immediately began...
4
5325
by: Lee Chapman | last post by:
Hi, Can anyone tell me why in the code below, the call to ClearChildViewState() has no effect? To paraphrase the code: I'm using view state. I have a textbox and a submit button (and a label that can be ignored). When I press the button the first time, the click handler hides the textbox. Pressing the button a second time unhides the textbox. The text box is maintaining its value when hidden via view state. (The value is NOT being...
8
6798
by: John J. Hughes II | last post by:
Is there a way of resetting the SqlConnection with closing/opening it again. I am not seeing anything called reset. Regards, John
14
12790
by: ahlongxp | last post by:
Hi, everyone, I'm implementing a simple client/server protocol. Now I've got a situation: client will send server command,header paires and optionally body. server checks headers and decides whether to accept(read) the body. if server decided to throw(dump) the request's body, it'll send back a response message, such as "resource already exists" and close the connection.
16
2084
by: Giovanni D'Ascola | last post by:
Hi. I noticed that <input type="reset"actually don't enable checkbutton which are checked by default after they have been disabled by javascript. It's a bug?
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9111
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8096
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4517
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4782
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.