473,503 Members | 2,049 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamiccly show/hide text boxes

6 New Member
I have a from with three radio buttons (same group) and three text boxes. The radio buttons give the user a choice of uploading one, two, or three images. Currently, I have the text boxes load as disabled and the radio button selection enables the needed text boxes. It works but...

I don't want to see the text boxes unless they are needed and I want the user to be able to change their mind. (ie choose three images or go back to one image)

this is what I am using right now:
Expand|Select|Wrap|Line Numbers
  1. <table width="800px"> 
  2. <tr>
  3. <td>
  4. <!--Select how many images and disable unused text boxes--> 
  5. <form action="code.php" method="post">
  6. <input type="radio" name="myRadioButton" value="1" onclick="image1.disabled=false;" /> 1 Picture
  7. <input type="radio" name="myRadioButton" value="2" onclick="image1.disabled=false; image2.disabled=false;"/> 2 Pictures
  8. <input type="radio" name="myRadioButton" value="3" onclick="image1.disabled=false; image2.disabled=false; image3.disabled=false" /> 3 Pictures
  9.  
  10.  
  11.  
  12. <!--Information-->
  13.  
  14.   <p>Enter the Auction Title:
  15.   <input type="text" name="title"  cols="50" />
  16.  
  17.   <br />
  18.   <br />
  19.     Enter A Description: 
  20.   <textarea cols="50" rows="10" wrap="soft" name="description"></textarea>
  21.   <br />
  22.   <br />
  23.     Enter the URL for Image 1: <input type="text" name="image1" disabled="disabled" />
  24.   <br />
  25.   <br />
  26.     Enter the URL for Image 2: <input type="text" name="image2" disabled="disabled" />
  27.   <br />
  28.   <br />
  29.     Enter the URL for Image 3: <input type="text" name="image3" disabled="disabled" />
  30.  
  31.   </p> 
  32.   <p>
  33.  
  34.  
  35.  
  36.  
  37.     <input type="submit" name="submit1" value="Generate Auction Code"/>
  38.   </p>
  39.  
  40. </form>
  41. </td>
  42. </tr>
  43. </table>
Apr 25 '09 #1
1 2550
gits
5,390 Recognized Expert Moderator Expert
you may use the style.display property to do so ... let me give you a simple example for it:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function toggleVisibility(checkbox, nodeId) {
  5.     var node = document.getElementById(nodeId);
  6.     node.style.display = checkbox.checked ? 'block' : 'none';
  7. }
  8. </script>
  9. <body>
  10.     <input type="checkbox" onclick="toggleVisibility(this, 'foo');"/>
  11.     <input type="text" id="foo" style="display: none;"/>
  12. </body>
  13. </html>
  14.  
kind regards
Apr 26 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
4625
by: oLE | last post by:
I would like to add some javascript to show/hide a certain row of a table. The first row of the table contain the hyperlink that calls the javascript the second row is the one i want to show/hide...
7
10123
by: Mark | last post by:
Hi All, I have a report which is based on a query which is used to produce QC check sheets. I have quite a few text boxes which are used to display questions depending on the value of one...
5
3597
by: tlyczko | last post by:
Hello, I've searched on toggling divs and didn't really find what I was looking for, I saved a bunch of different threads. I have a form with several different text boxes for things like dates,...
8
2473
by: Andrew | last post by:
Hello, friends, We created a drop-down menu bar and a show/hide calendar web user controls mainly using javaScript and html. However, they both have the problem that they are not dispaly as...
1
16723
by: asilverpeach | last post by:
Hey Guys! Found some great scripts here on this topic but have to make to changes to the code that I can't seem to figure out. First, In the following code clicking on the headers shows the...
5
8411
by: ali | last post by:
Hello every one i need you help regarding div hide and show. i am having a link like <a href="#" onClick="expandWin()">show/hide </a> <div id=showHide> </div> within div i have lots of...
1
4150
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. ...
3
3604
by: spranto | last post by:
Hi to you all once again, I'm dealing with user point of view difficulties. I have a 3x3 "matrix" made with text boxes. Some cases require only 2x2. My problem is: How do I hide, or lock...
1
3782
oranoos3000
by: oranoos3000 | last post by:
hi would you please help me i have a online shopping center that i show pictures of the my product in home page. in the InterExplorer pictures is shown correctly but in Firefox browser is shown...
0
7204
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7091
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...
0
7342
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...
0
5586
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,...
1
5018
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4680
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...
0
3171
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...
0
1516
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 ...
0
391
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...

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.