473,749 Members | 2,665 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript checkbox to hide fields if checked

Hello all,

I saw this post on google that contained the following code and I
tried it but it did not work. I am trying create two contact forms and
it the info in the first form is the same contact info that would be
on the second, the enduser can check a box to hide all of the
addtional fields. Below if the original code.

<input type="checkbox"
onclick="if(doc ument.all)del.s tyle.display='n one'"">
<div id ="del">
Your address <input type="text" name="address">
.....the rest of the deleivery fields
</div>
Thanks!!!
Jul 23 '05 #1
1 6972
DettCom wrote:
Hello all,

I saw this post on google that contained the following code and I
tried it but it did not work. I am trying create two contact forms and
it the info in the first form is the same contact info that would be
on the second, the enduser can check a box to hide all of the
addtional fields. Below if the original code.

<input type="checkbox"
onclick="if(doc ument.all)del.s tyle.display='n one'"">
<div id ="del">
Your address <input type="text" name="address">
....the rest of the deleivery fields
</div>
Thanks!!!


Hi,

It worked OK on IE6 on XP

Kien
Jul 23 '05 #2

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

Similar topics

4
3218
by: Andrew Clark | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** hello, i am trying to create a login page to my website. there are the usual fields for name and password, but i want 2 more: a checkbox that a new user will check, and then another text input that will appear if the box is checked. is it possible to have this happen dynamically? i.e. the 2nd password box will appear if it is checked, but it will disappear if it is...
2
1864
by: Cliff R. | last post by:
Hello, I have a form that has a few required fields and also an "agree to terms" checkbox that must be required. I have used Javascripts for both functions individually, but I need a little help in combining them. Can someone help me combine these two scripts so they both work on the same page, with <FORM METHOD=POST onSubmit="return checkrequired(this)" etc., checking for required fields and making sure the agree-to-terms button is...
2
3684
by: Luis Esteban Valencia Muñoz | last post by:
I have a datagrid that displays editable text fields (2 different price fields) and a checkbox in every row. It has a "SaveChanges" button at the bottom, which, when pressed, looks at every checkbox in the datagrid, if it is checked, it updates the corresponding rows prices. That works, no problem. What I need to do is that when a user clicks into either of the price text fields, the checkbox automatically checks itself. This will save...
6
1910
by: drec | last post by:
I am just learning Javascript and I would like to create a basic form that gives me two options. This will be using either checkbox or radio input type, however I would like the second option to allow the user to type in a value. Also, I would like the 2nd option only editable if the button for that option is selected. All I can seem to find is basic examples of forms, and none of which have this feature. The form would look something...
5
1913
by: Peter Afonin | last post by:
Hello, I'm not an expert in Javascript, so I'm seeking an advice. As I mentioned in my previous post, I use Javascript to check whether at least one checkbox in the datagrid has been checked. I have to use Stringbuilder to do this: Dim iCount As Int32 Dim sClientSideValidate As New StringBuilder
5
4919
by: widevision7 | last post by:
I have a web site that uses the following JavaScript to hide <div> sections: <script type="text/javascript"> function showMe (it, box) { var vis = (box.checked) ? "block" : "none"; document.getElementById(it).style.display = vis; } </script> I have a checkbox to hide the <div> when checked:
4
3076
by: somasekhar | last post by:
Does anyone know how to have a user click a checkbox to unhide a editfield Unclick of the checkbox would hide it again. There is an example of html file on the Javascript .But I want hide and unhide same as in xml file plz give me the answer with example any body knows. <html> <head> <title>CB Hide/Show</title> <script type="text/javascript"> <!-- function showMe (it, box) { var vis = (box.checked) ? "block" : "none";...
3
1708
by: ayush patel | last post by:
Hi, I have an application in which clicking on a checkbox should make rest of the checkboxes checked. its rather simple. I have never used Javascript before so i have no clue how to get through this. here's my code. this is the checkbox which on checked should make other check boxes checked. <td > input <%If (Session("stateid") <> "") Then Response.Write("checked=""checked""") : Response.Write("")%> name="stateid" type="checkbox"...
0
8833
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
9389
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...
1
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
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
8257
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
4709
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
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2218
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.