473,473 Members | 2,255 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

getting value from radiobutton

I would like to make a script wich makes a select visible or not visible
depending on what radio button is selected.

If the radiobutton with the value "nieuw" is selected the pulldown is not
visible and when i select the radiobutton with the value "verwijderen" the
pulldown should become visible.

The code i have makes the pull down visible but does not make it invisible
after i select another radiobutton.

This what i have so far:
<script language="JavaScript">
<!--
function Menue()
{
if (document.all.keuze.value == "nieuw")
{
document.all.naam_keuze.style.visibility="hidden"
}
else
{
document.all.naam_keuze.style.visibility="visible"
}
};

//-->
</script>
</head>

<body>
<h1>Specialisten / zorgverleners</h1>

<p align="left">
<input id="keuze" type="radio" name="keuze" value="nieuw"
onClick="Menue()">
Nieuw
<input id="keuze" type="radio" name="keuze" value="bewerken"
onClick="Menue()">
Bewerken
<input id="keuze" type="radio" name="keuze" value="verwijderen"
onClick="Menue()">
Verwijderen<img src="images/spacer.gif" width="100" height="5">
<select id="naam_keuze" size="1" name="keuze" style="visibility:visible">
<option>roy</option>
<option>jan</option>
<option>hans</option>
<option>piet</option>
</select>
</p>

thanks

roy
Jul 23 '05 #1
1 3826

"R.G. Vervoort" <ro**********@royvervoort.nl> a écrit dans le message de
news:40*********************@news.xs4all.nl...
I would like to make a script wich makes a select visible or not visible
depending on what radio button is selected.

If the radiobutton with the value "nieuw" is selected the pulldown is not
visible and when i select the radiobutton with the value "verwijderen" the
pulldown should become visible.

The code i have makes the pull down visible but does not make it invisible
after i select another radiobutton.

This what i have so far:
<script language="JavaScript">
<!--
function Menue()
{
if (document.all.keuze.value == "nieuw")
Try this:
function Menue(selection)
{
if (selection == "nieuw")
{
document.all.naam_keuze.style.visibility="hidden"
}
else
{
document.all.naam_keuze.style.visibility="visible"
}
};

//-->
</script>
</head>

<body>
<h1>Specialisten / zorgverleners</h1>
Change also onClick="Menue()" to onClick="Menue(this.value)"

<p align="left">
<input id="keuze" type="radio" name="keuze" value="nieuw"
onClick="Menue()">
Nieuw
<input id="keuze" type="radio" name="keuze" value="bewerken"
onClick="Menue()">
Bewerken
<input id="keuze" type="radio" name="keuze" value="verwijderen"
onClick="Menue()">
Verwijderen<img src="images/spacer.gif" width="100" height="5">
<select id="naam_keuze" size="1" name="keuze" style="visibility:visible"> <option>roy</option>
<option>jan</option>
<option>hans</option>
<option>piet</option>
</select>
</p>

thanks

roy

Jul 23 '05 #2

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

Similar topics

8
by: VK | last post by:
Hi! What I'm missing in following code? Cannot get the values of radiobuttons. Starting only one class (GetVariant), it works. When I put two classes together, it doesn't. Regards, VK from...
2
by: bbxrider | last post by:
i have 2 radio buttons 1 for yes and 1 for no, it is mandatory for one to be checked, and am purposely leaving both blank on the page when i tested for .value, when neither was checked, an alert...
2
by: JeffFinnan | last post by:
<form name=form1> Load in Viewer Window: <input name="radiobutton" type="radio" value="1" checked onClick="1"> 1&nbsp;&nbsp;&nbsp; <input type="radio" name="radiobutton" value="2" onClick="2">...
1
by: MickG | last post by:
I am trying to change the value of the variable "hard" according to which radio button is pressed and I am having no joy. Could anyone help me with this, the problematic section is marked with...
4
by: darrel | last post by:
I have a contact form that a person submits to the server. In ASP, you'd make a page, post the form to another page, which would grab the values and do somethign with them. in ASP.NET, it...
2
by: Rob | last post by:
Hi all, I've got multiple sets of radio button that are dynamically created in code and populated by a database query. The query returns about 20 recordsets with 3 radio buttons per recordset and...
2
by: Rich | last post by:
Hello, Is it possible to assign a value to a groupbox by selecting a radiobutton contained in the groupbox? Say you assign a value of 1 to radbtn1, 2 for radbtn2, 3 for radbtn3 all contained...
0
by: Nathan Sokalski | last post by:
In the RadioButton and CheckBox controls, there is no Value attribute. The html <inputtag has a value attribute, which is used by both type="radio" and type="checkbox". The RadioButtonList and...
12
by: ive1122 | last post by:
Hi guys, I am looking into create a dynamic survey as posted in Get User Input From Dynamic Controls but with some different environment Below is what i am trying to do: First when the user...
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
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
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,...
1
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
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
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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.