...

View Full Version : Please help!!



bprego
03-17-2005, 10:22 PM
I have a problem! I have four radio buttons named searchtype. Each button has its own value lets say one, two, three, four. when buttons two through four are selected i want a text box with the text enter city in it. Below that I want a dropdown list with the values a, b, c, d for radio two. e,f,g,h for radio three, and i,j,k,l for radio four. when radio one is selected i want a drop down list with a1,b1,c1,d1, and below that another drop down the same as if radio two was selected.

So now that I have totally lost you, is there anyone who can help me? Thanks in advance. bprego

A1ien51
03-17-2005, 10:24 PM
Why don't you try coding something....

bprego
03-18-2005, 03:29 PM
If i knew how to do this why would I ask for help?? Could you at least get me started?

vwphillips
03-18-2005, 04:56 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>
<title></title>
<script language="JavaScript" type="text/javascript">
<!--
// values a, b, c, d for radio two.
var twoAry=new Array( 'a', 'b', 'c', 'd');

// values e, f, g, h for radio three.
var threeAry=new Array( 'e', 'f', 'g', 'h');

// values i, j, k, l for radio four.
var fourAry=new Array( 'i', 'j', 'k', 'l');

function SearchType(val){
document.getElementById('entercity').style.visibility='visible';
if (val=='one'){ document.getElementById('entercity').style.visibility='hidden'; }
else {
Ary=eval(val+'Ary');
for (i=0;i<Ary.length;i++){
document.getElementById('Sel1').options[i]=new Option(Ary[i],Ary[i],true,true);
}
document.getElementById('Sel1').selectedIndex=0;
if (val=='two'){
for (i1=0;i1<Ary.length;i1++){
document.getElementById('Sel2').options[i1]=new Option(Ary[i1],Ary[i1],true,true);
}
document.getElementById('Sel2').selectedIndex=0;
}

}
}

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

<body>
I have a problem!
I have four radio buttons named searchtype. <br>

Each button has its own value lets say one, two, three, four.<br>
<input type="radio" name="searchtype" value="one" onclick="javascript:SearchType(this.value);" ><br>
<input type="radio" name="searchtype" value="two" onclick="javascript:SearchType(this.value);" ><br>
<input type="radio" name="searchtype" value="three" onclick="javascript:SearchType(this.value);" ><br>
<input type="radio" name="searchtype" value="four" onclick="javascript:SearchType(this.value);" ><br>
when buttons two through four are selected i want a text box with the text enter city in it.<br>
<input id="entercity" size="10" value="enter city" style="visibility:hidden;" ><br>

Below that I want a dropdown list with the values a, b, c, d for radio two.<br>
e,f,g,h for radio three, <br>
and i,j,k,l for radio four.<br>
when radio one is selected i want a drop down list with a1,b1,c1,d1,<br>
<select name="Sel1" size="1" style="width:50px;" >

</select>
<br>
and below that another drop down the same as if radio two was selected.<br>
<select name="Sel2" size="1" style="width:50px;" >
</select><br>
I have made the text = val so you can see something happening<br>
</body>

</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum