473,378 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

To invoke a textbox when radio button clicked

There 2 radio buttons.when a radio is clicked textbox should appear,when another radio clicked the existing textbox should disappear and new textbox should be enabled.
Sep 23 '08 #1
4 2353
Dormilich
8,658 Expert Mod 8TB
sounds like a neat effect.....
Sep 23 '08 #2
hsriat
1,654 Expert 1GB
Use onclick event of the radio buttons to display and hide the textareas accordingly. style.display can be useful.
Sep 24 '08 #3
acoder
16,027 Expert Mod 8TB
Not a HTML question. Moved to the JavaScript/DHTML forum.

Moderator.
Sep 28 '08 #4
onclick of the radio call a function like this
[HTML]
<input type="radio" id="myRadio" name="myRadio" onclick="enable_disable();"\>
<input type="text" id="myRadioTextone" name="myRadioText" class="optional" style="display:none"/>

<input type="text" id="myRadioTexttwo" name="myRadioText" class="optional" style="display:none"/>[/HTML]

Expand|Select|Wrap|Line Numbers
  1. function enable_disable()
  2. {
  3.  
  4. var textFieldone=document.getElementById('myRadioTextone');
  5. var textFieldtwo=document.getElementById('myRadioTexttwo');
  6. textFieldone.style.display='block';
  7. textFieldtwo.style.display='none';
  8. }
similiarly for the second radio do viceversa
Sep 29 '08 #5

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

Similar topics

3
by: Claire Osborne | last post by:
I have created a form at http://www.habitatforhumanity.org.uk/html/gv_indiv_apply.htm In the Medical Details section we need to ensure that if a radio button is clicked to indicate a health...
2
by: Bart Verbeke | last post by:
Hi, I have a form with 2 radio buttons (ACCEPT/REJECT). When the page is initially loaded, no textbox should be visible. When a user clicks the REJECT radio button, a textbox should...
1
by: sarj | last post by:
Hi.... I have a asp:textbox whose text needs to be set when a radio button is clicked. The text would correspond to the value of the particular. However, although the text is correctly set in...
11
by: bill | last post by:
I dynamically create buttons and associate them with an event using AddHandler. I want all the button events to fire at one time, when the page is posted, instead of when each button is clicked....
1
by: namanhvu | last post by:
Hi everyone, I'm trying to create a form where the radio button is automatically selected when the input text field beside it is clicked. I know I need to use "onClick" somewhere but I don't...
1
by: jw01 | last post by:
Im trying to write a java script in HTML in which when a particular radio button is selected, a textbox would appear write next to the selected item. e.g (RADIO BUTTON) fhd: (RADIO BUTTON) fdj:...
2
by: jw01 | last post by:
I changed my code...Now everytime i click a radio button, a text box appears...What i want is when i hit a particular radio button, the textbox should only appear next to that radio button. And if...
2
by: Peted | last post by:
I have 6 radio buttons in a column with a single line text box next to each rb. is there a general straightforward way to link a radio button to the textbox next to it. I want to be able to...
5
by: Kulgan | last post by:
Hi all, Is it possible in javascript to add a textbox when the last of three radiobuttons is clicked ? thanks !
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.