473,405 Members | 2,379 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,405 software developers and data experts.

Change the visibility of checkbox and textbox

ammoos
100 100+
Hi friends
I am using the asp.net 2003 and I would like to change the visibility of a checkbox and textbox to “true” when I click on a radio button… I want to do this function by using JavaScript…
Pls help me...
Aug 4 '07 #1
10 12026
pbmods
5,821 Expert 4TB
Heya, ammoos.

For that, you'll want to use document.getElementById() to select each element and then set the style.visibility property for each one to 'visible'.
Aug 4 '07 #2
gits
5,390 Expert Mod 4TB
hi ...

please post some example code you have done alredy. you would need to call a js-function onclick of the radio-button. that function may use getElementById(); to retrieve a reference to the check- and textbox where you have to set the style to 'display:none' (hidden) or 'display:block' (visible) ...

kind regrads
Aug 4 '07 #3
gits
5,390 Expert Mod 4TB
heya pbmods ...

we did the sametime-posting again :)
Aug 4 '07 #4
pbmods
5,821 Expert 4TB
heya pbmods ...

we did the sametime-posting again :)
Tag. You're it!
Aug 4 '07 #5
ammoos
100 100+
Thanks a lot for your suggestions friends …
I added javascript functions for two radio buttons(asp.net web controls).. and the script finctions are
Expand|Select|Wrap|Line Numbers
  1. <script language="javascript" type="text/javascript">    
  2. function setAll()
  3. {            
  4. document.getElementById('TextBox1').style.visibility='visible';
  5. document.getElementById('TextBox2').style.visibility='hidden';
  6. document.getElementById('CheckBox1').style.visibility='hidden';
  7. document.getElementById('DropDownList1').style.visibility='hidden';
  8. }
  9. function setGasOnly()
  10. {
  11. document.getElementById('TextBox1').style.visibility='hidden';
  12. document.getElementById('TextBox2').style.visibility='visible';
  13. document.getElementById('CheckBox1').style.visibility='visible';
  14. document.getElementById('DropDownList1').style.visibility='visible';
  15. }
  16. </script>
this working well.. but i want to do addition thing is that when i click on one radio button... change the selection of other radio button if it selected... can you pls help me...
Aug 6 '07 #6
pbmods
5,821 Expert 4TB
Heya, ammoos.

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.
Aug 6 '07 #7
ammoos
100 100+
Heya, ammoos.

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.


Sure Pbmods... I will follow your advise from next time... thanks
Aug 7 '07 #8
acoder
16,027 Expert Mod 8TB
but i want to do addition thing is that when i click on one radio button... change the selection of other radio button if it selected... can you pls help me...
Are these two different radio buttons? In a set of radio buttons, only one can be selected at any one time.
Aug 7 '07 #9
ammoos
100 100+
Are these two different radio buttons? In a set of radio buttons, only one can be selected at any one time.


yes... its two different radio buttons
Aug 7 '07 #10
acoder
16,027 Expert Mod 8TB
yes... its two different radio buttons
Can you show the HTML for the radio buttons?
Aug 7 '07 #11

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

Similar topics

4
by: DebbieG | last post by:
I have a form based on this query: SELECT Students.LastSerDT, OtherInfo.Served, OtherInfo.HSGradYr, OtherInfo.ActivePart, OtherInfo.Served, Students.SSN, & ", " & & " " & AS Name,...
1
by: Feng | last post by:
I have a web form A that contains a TextBox. A pop up window started by my form A will return a value and put it into the TextBox. What I need to do is that when this happens (when the value gets...
7
by: Richard Bond | last post by:
Hi Is there anyway to change the characterset/codepage of a specific textbox on a winform. I have read in a "chinese traditional big5" file into memory using a streamreader with the...
2
by: simon | last post by:
hello, new to vb.net, have a few questions about DataGrid. I have a dataGrid that is working pulling a dataset back from a stored proc and binding to the datagrid for display the datagrid's...
1
by: savajx1 | last post by:
I need to dynamically create a set of bound fields contained in a GridView control. I also have a single static CommandField that I can declare in the Columns <tagof the GridView control. I have...
8
by: shruthiKKKK | last post by:
change appearence for textbox by using combolist
5
mafaisal
by: mafaisal | last post by:
Hello Experts I am Using Vb.net2005 windows app My Doubt is How we can change the height of TextBox without multiline ie, in multi line textbox we can change but other Fixed height !! Hw can...
1
by: Mythilisg | last post by:
hi i'm having dropdown list control. i want to activate the visibility of a textbox based on the selected value of dropdown list. The problem is the page gets refresh every time when i choose the any...
4
by: neelsfer | last post by:
I have an option group with 2 checkboxes : MtbAge - option value = 1 RoadAge - option value = 2 The textbox where to display MtbAge/RoadAge is called = currentage if you select MtbAge it...
0
by: Chocolade | last post by:
I created a new form and added split container and then on the left side a treeview and on the treeview i added nodes and on the right side of the split container i added a groupbox. Now in the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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,...
0
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
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...
0
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...
0
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,...
0
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...

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.