•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 402,616 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,198 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 649 | Replies: 2
![]() |
•
•
Join Date: Oct 2007
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
I have a form with a reset button and what I want is to reset only some form elements when that button is clicked.
Now I want the checkbox to be reset when I click the reset button is clicked and let the textbox retain its value
Is it possible?
<form name="frmMyForm"> <input type="text" name="txtText" /> <input type="checkbox" name="chkCheckBox" /> <input type="reset" value="reset" /> </form>
Is it possible?
•
•
Join Date: May 2008
Location: Nant-y-moel, South Wales
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 0
I don't know if this is the BEST way to do it, but this would work :
<head>
<script language="javascript">
function fnMyReset() {
document.frmMyForm.chkCheckBox.checked = false;
}
</script>
</head>
<body>
<form name="frmMyForm">
<input type="text" name="txtText" />
<input type="checkbox" name="chkCheckBox" />
<!-- changed from type="reset" to type="button" -->
<input type="button" value="reset" onclick="fnMyReset()" />
</form>
</body>![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- FF vs IE dhtml/javascript/forms issue (JavaScript / DHTML / AJAX)
- Add Products to Products Table (ASP)
- Calculator JavaScript issue (JavaScript / DHTML / AJAX)
- ALL GMail invites to be posted here please! (Geeks' Lounge)
- Help Needed (PHP)
- how to validate checkbox with different names? (HTML and CSS)
- I've got Trojan.Holax... is this bad? (Viruses, Spyware and other Nasties)
- not-a-virusadware (Viruses, Spyware and other Nasties)
- a weird Javascript error (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Make columns equal height with Javascript
- Next Thread: Get different map data from Google Map ,Yahoo Map and VE



Linear Mode