Select functionality of drop down list

Ads
 

Select functionality of drop down list

View Answers

November 25, 2009 at 11:24 AM

Hi Friend,

Try the following code:

<html>
<head>
<script>

function hide(){
var combo1 = document.getElementById("combo");
var val = combo1.options[combo1.selectedIndex].text;
if(val=="Hide"){
document.getElementById('x').style.visibility='hidden';
}
else{
document.getElementById('x').style.visibility='visible';
}
}
</script>
</head>
<select id="combo" onchange="hide();">
<option value="Test1">Test1</option>
<option value="Test2">Test2</option>
<option value="Hide">Hide</option>
<option value="Test3">Test3</option>
</select>
<input type="text" id="x">

Thanks

January 13, 2011 at 5:34 PM

&lt;html&gt;
&lt;head&gt;
&lt;script&gt;

function hide(){
var combo1 = document.getElementById("combo");
var val = combo1.options[combo1.selectedIndex].text;
if(val=="Hide"){
document.getElementById('x').style.visibility='hidden'; 
}
else{
document.getElementById('x').style.visibility='visible'; 
}
}
&lt;/script&gt;
&lt;/head&gt;
&lt;select id="combo" onchange="hide();"&gt;
&lt;option value="Test1"&gt;Test1&lt;/option&gt;
&lt;option value="Test2"&gt;Test2&lt;/option&gt;
&lt;option value="Hide"&gt;Hide&lt;/option&gt;
&lt;option value="Test3"&gt;Test3&lt;/option&gt;
&lt;/select&gt;
&lt;input type="text" id="x"&gt;

Ads









Related Tutorials/Questions & Answers:
dynamic drop down list
dynamic drop down list  I want to create 2 drop down list, where it takes value from database and the two list are dependent..means if I select a particular value from one the other list is developed accordingly..depending
Dependent drop down list
dependent drop down list is used my code is successful but when i select class from first drop down list all the data get lossed means the value entered in fields before drop down list get blank.what can i do for this? This is the code
Advertisements
Get values in drop down list
Get values in drop down list  Pls provide me jsp code to get values in drop down list from another table's field. my project has customer... in drop down box in front end..... pls provide me code.. thanx
Dependant & dynamic drop down list
be in this or AJAX forum. I have one dynamic drop down list from data base (working... on the values selected by user in first drop down list. How to achieve this ?   ...`));   This will select only ONE row (country) from first drop down. In my case
Drop down list from database
Drop down list from database  Hi, Can I know how do we get the drop down list from database? Eg: select country--select state--select district--so...; <body> <select name='country' onchange="showState(this.value
store values of drop down list box in database
store values of drop down list box in database  how to store values of drop down list box in oracle database in jsp?I have information inserting form where i have date of birth as drop down list box
view data from database using drop down list
view data from database using drop down list  hi i want to view the data from database by selecting a value in a drop down list. for an example drop down list have picture element.when click it select pictures from the database
Select from drop down and load the appropriate application resource.properties in struts2
Select from drop down and load the appropriate application resource.properties in struts2  I would like to use a dropdown for selecting a language in my application .On selecting a language the appropriate
Display related data in other drop down list on selecting one data in one drop down list
Display related data in other drop down list on selecting one data in one drop down list  How to display related datas in dropdown list from database on selecting one data in previous dropdownlist in Java Server Page
Dependant & dynamic drop down list - Follow up
Dependant & dynamic drop down list - Follow up  Thanks for your answer. As per your answer This will select only ONE row (country) from first drop down. In my case user can choose more than one row , which is then sent to next
Add values of drop down menu( select option) to mysql table
Add values of drop down menu( select option) to mysql table   Here is my code <?php echo $row['valveName'].'<td>'.$row['valveId'].'<td>'; echo '<select name="onoff">'; echo '<
Excel Cell Drop Down List
Excel Cell Drop Down List In this section, you will learn how to validate data entered in a cell and provide a drop down list of possible values to the user... the following error message : You can select the value from the drop down
to update drop down list value when selected from website
to update drop down list value when selected from website  hi help me, i want to insert value into db when i select from a drop down list...)&& ($select!="")){ $select=$_POST['NEW']; } ?> <?php $list
to update drop down list value when selected from website
to update drop down list value when selected from website  hi help me, i want to insert value into db when i select from a drop down list...)&& ($select!="")){ $select=$_POST['NEW']; } ?> <?php $list
to update drop down list value when selected from website
to update drop down list value when selected from website  hi help me, i want to insert value into db when i select from a drop down list...)&& ($select!="")){ $select=$_POST['NEW']; } ?> <?php $list
How to create a dependent drop down list using [Apache POI]
How to create a dependent drop down list using [Apache POI]  Here I.... In that two drop down list are there. Want to create a drop down list that depends on previous cell's drop down. For example: If I select veg category in cell 3
How to create a dependent drop down list using [Apache POI]
How to create a dependent drop down list using [Apache POI]  Here I.... In that two drop down list are there. Want to create a drop down list that depends on previous cell's drop down. For example: If I select veg category in cell 3
how to retreive data dynamically from mysql to drop down list
how to retreive data dynamically from mysql to drop down list   sir, i created a table in mysql and i inserted some values into the table through... the data of a particular column in a table into drop down list dynamically
The code for retrieving data from database into Drop Down List.
The code for retrieving data from database into Drop Down List.  <...; Book List : - select - <% while... to MySQL"); PreparedStatement pre = con.prepareStatement("select * from
retrive the data from access database to drop down list box in jsp
retrive the data from access database to drop down list box in jsp  hai, im new to jsp now im using the jsp along with access database.in table i load all the data's i need to retrive the data from database to dropdown list box
drop down menu
drop down menu  drop down menu using html
Drop Down reload in IE
Drop Down reload in IE  Hi i was using two drop down box..One for Displaying date followed by another for Dispalying Month..If i Select/Change Month from the 2nd drop down then the 1st drop down ( which is date) automatically
how to make drop down list in JSF & fetch data Item from database
how to make drop down list in JSF & fetch data Item from database  how to make drop down list in JSF & fetch data Item from database
How to pass parameter through drop down list using session management in jsp??
How to pass parameter through drop down list using session management in jsp??  How to pass parameter through drop down list in the URL and access it on same jsp page using session management
drop down
drop down  how can i add data from choice/dropdown component of java awt to myaql table
Drop Down
Drop Down  How to insert date into database using dropdown like facebook
Drop down for search textbox like google search
Drop down for search textbox like google search  I want drop down like google search (ie, when we type one letter then the word start with that are displayed). when the drop down list appear, then we can select one of word as our
Drop down menu
Drop down menu  I have drop down list of some 14 links which links to the table,If i click each link the table should display below the link and again if i click the link the table should not appear. please help me
Drop down menu
Drop down menu  I have created a drop down list of links which links to a table but if i click the link the table display in the other page i want to display it in the same page.Please tell me the solution
How to insert multiple drop down list data in single column in sql database using servlet
How to insert multiple drop down list data in single column in sql database using servlet  i want to insert date of birth of user by using separate drop down list box for year,month and day into dateofbirth column in sql server
Login With Drop Down
a drop down list consisting of Customs and Accounts. I have user accounts of both the departments. Now, my intention is to select the department from the drop down box and then login to the page. I have a drop down list box with Customs

Ads