how can I make a list menu appear when I select an option from a drop down list or menu??? Note: it appears automatically next the previous one or where ever we want!
Somebody can help me please. How to create onclick it same with
Payment method
https://secure.elance.com/php/reg/main/buyersignup.php?emailSignupsId=555209
<form action="#" method="post">
Music :<input type="radio" name="Suggestion">
Hobby:<input type="radio" name="suggestion">
</form>
Then the problem. When the user click music button, automatic have what is the music type form.
Hi,
you should find freelance developer to solve your problem, i gave you solution, all you have to do is just upgrade it and you will have complete solution
Example:
<html>
<head>
<script language="javascript">
function dgi(el)
{
return document.getElementById(el);
}
function hide_show(obj)
{
var a = dgi('first');
var b = dgi('two);
var c = dgi('three');
if(obj.value == '2')
{
b.style.display = '';
a.style.display = 'none';
c.style.display = 'none';
}
if(obj.value == '1')
{
b.style.display = 'none';
a.style.display = '';
c.style.display = 'none';
}
if(obj.value == '3')
{
b.style.display = 'none';
a.style.display = 'none';
c.style.display = '';
}
}
</script>
</head>
<body>
<select id="one" onchange="hide_show('two', this);">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
<select id="first" style="display: none;">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
<select id="two" style="display: none;">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
<select id="three" style="display: none;">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
</body>
</html>
this was not hard, all you need is just think about it.
I am trying to make that script into for loop:
wht I want to get is that whenever I select option one or two r three its another menue appear
function dgi(el)
{
return document.getElementById(el); }
function hide_show(id, obj) {
for (var i=0; i <4; i++ ){var b = dgi(id);
if(obj.value == ‘i’)
{ b.style.display = ‘’;}
else
b.style.display = ‘none’;
} }
</script>
</head>
<body>
<select id=“one” onchange=“hide_show(‘two’, this);”>
<option value=“1”>One</option>
<option value=“2”>Two</option>
<option value=“3”>Three</option>
</select>
<select id=“two” style=“display: none;”>
<option value=“1”>One</option>
<option value=“2”>Two</option>
<option value=“3”>Three</option>
</select>
<select id=“three” style=“display: none;”>
<option value=“1”>One</option>
<option value=“2”>Two</option>
<option value=“3”>Three</option>
</select>
<select id=“three” style=“display: none;”>
<option value=“1”>One</option>
<option value=“2”>Two</option>
<option value=“3”>Three</option>
</select>
<html>
<head>
<script language="javascript">
function dgi(el)
{
return document.getElementById(el);
}
function hide_show(id, obj)
{
var b = dgi(id);
if(obj.value == '2')
{
b.style.display = '';
}
else
b.style.display = 'none';
}
</script>
</head>
<body>
<select id="one" onchange="hide_show('two', this);">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
<select id="two" style="display: none;">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
</body>
</html>
i hope that this will help you
okie. let’s say I have a select drop list has many options. When I select on of them, another drop list, or text field… ect appears from hidden to visible.
Hope make it clear this time!
could you give more details?
thanks alot triLli! I am just new to javascript.
if you could tell me wht’s the best book or website for mastering javascript:).
Thanks alot trilli,
it is really something. But how can I make it more flixible, whenever I choose option one another menus appear, and when I select option three another menus appear and so on.
<select id=“one” onchange=“hide_show(‘two’, this);”>
<option value=“1”>One</option>
<option value=“2”>Two</option>
<option value=“3”>Three</option>
</select>
Thanks alot for your reply!
I was trying this function but I couldn’t make it right. Can u help me with that?
<script>
function changeme(id, action) {
if (action==“hide”) {
document.getElementById(id).style.display = “none”;
} else {
document.getElementById(id).style.display = “block”;
}
}
</script>
<select name=“select” id=“select”>
<option>location_001</option>
<option onclick=“if(document.getElementById(‘select2’).style.display==‘block’)
{
else {document.getElementById(‘select2’).style.display=‘none’;}”>location_002</option>
<option>location_003</option>
<option>location_004</option>
</select>
<select name=“select2” id=“select2” style=“display:block”>
<option>area_001</option>
<option>area_002</option>
<option>area_003</option>
<option>area_004</option>
:sick:can anyone tell me the answer?.. I am relly new to avscript I don’t have so much clue about it!
<style>
select
{
float: left;
width: 100px;
}
</style>
<script language="javascript">
function show(obj)
{
document.getElementById(obj).style.display = '';
}
</script>
<select id="one" onchange="show('two');">
<option value="0"></option>
<option value="1">1</option>
<option value="2">2</option>
</select>
<select id="two" style="display: none;">
<option value="0"></option>
<option value="1">1</option>
<option value="2">2</option>
</select>
I hope this helps