HTML

HTML

View Answers

October 20, 2008 at 6:17 PM

HI friend,


This is simple code. I hope that this code will help you.


<html>
<head>
<title>combo</title>
<script language="javascript">
var hardcoded_values = new Array();
hardcoded_values[0] = "";
hardcoded_values[1] = new Array("option 1 - part 1","option 1 - part 2","option 1 - part 3");
hardcoded_values[2] = new Array("option 2 - part 1","option 2 - part 2");
hardcoded_values[3] = new Array("option 3 - part 1","option 3 - part 2","option 3 - part 3","option 3 - part 4");

function combo1_selection_changed(combo1){
// get the selected value from combo1:
var combo1_value = combo1.value;

//make sure combo2 is empty:
document.forms["testForm"].elements["combo2"].options.length=0;
//loop throught the hard-coded values:
for (var i=0;i<hardcoded_values[combo1_value].length;i++){
// dynamically create a new <option> element:
var opt = document.createElement("option");
// set the value-attribute of it:
opt.setAttribute('value',i+1);
// set the displayed value:
opt.innerHTML = hardcoded_values[combo1_value][i];
// append this option to combo2:
document.forms["testForm"].elements["combo2"].appendChild(opt);
}
}
</script>
</head>
<body>
<center>
<h1>Select Combo Box Example</h1>
<form name="testForm" action="" method="post">
<select name="combo1" onchange="combo1_selection_changed(this);">
<option value="0">-- select --</option>
<option value="1">option 1</option>
<option value="2">option 2</option>
<option value="3">option 3</option>
</select><br />
<select name="combo2">
</select>
</form>
</center>
</body>
</html>

---------------------------

Thanks.









Related Tutorials/Questions & Answers:
HTML
HTML  What is Semantic HTML? What are the reasons for validating a HTML
HTML
HTML  What is Semantic HTML? What are the reasons for validating a HTML
Advertisements
HTML
HTML  What is SPAN in HTML
HTML
HTML  What is HTML? What is a Hypertext link
Html
Html  What is HTML? What is a Hypertext link
HTML
HTML  What is HTML? What is a Hypertext link
HTML
HTML  What is BODY in HTML document
html
html  diffrence between html and xml
html
html  How to add the calendar in html code
html
add a header in the html page  what we can do to add a header in the html page
HTML
HTML  how can we give the unlimited size in the html
HTML
HTML  How do we specify page breaks in HTML
HTML
HTML  What is a tag? How can we use MARQUEE in HTML
html
html  how to convert html page into jsp page
html
html  i want a registration page in html with good background
html
html  what we can do to add a header in the html page
html
html  what we can do to add a header in the html page
HTML
HTML  Hi, What is the full form of HTML? Thanks (adsbygoogle = window.adsbygoogle || []).push({});   Hi, The HTML stands for HyperText Markup Language. HTML is used to create webpage for world wide web
html
html  sir i am new to eclipse and i am created a html program and also tomcat is running successfully in side the eclipse.but now how i deploy that html program in the eclipse
HTML
HTML  How do we create a link? What are the three types of form tags in HTML
html
html  how we can give the form actions in html after register button in the login page
html
Adding Header in HTML  what we can do to add a header in the html page
html
html  Can we Access database through html page and how,if not then why
html
html  For what is used HTML?   Using HTML we can create a Web Page which can be viewed through a Web Browser over Internet. HTML describes... or the End Tag is defined as </> . The whole HTML document is enclosed
Html
Html  in the web page if judge select the age and category then automatically under that conditions the details will be display in the form of grid give me that code in html and java
html
html   write a html program to print "HELLO WORD"in red coaler font size 12 and italic stile   Here is a html code that display the message "Hello World" in red font with size 12 and in italics. <html> <
Html
Html  i am select the dateofbirth through the html browser.but it can not save into the sql server 2008 database.any special code required to store the date in database by using java servlets
HTML
HTML  I have created an info.html file for the applet.The class file is located in a directory different from the HTML file.The info.html file I have created is below. <HTML> <HEAD> <BODY> <APPLET Code
HTML
HTML  in html how can we can upload the file <tr> <td><strong>Video of the work:</strong> <td><b>... the file give me the code for this in html and java
HTML
HTML  how can we design the gird form view in html i want the following fields in the grid form The fields are Name of the candidate,Title... me the coding for this in html
html
html  Create a web page with the following using HTML i) To embed an image map in a web page ii) To fix the hot spots iii) Show all the related information when the hot spots are clicked.please reply me sir
Html
Html  I was designing a webpage, i need to create selection boxes one beside other, how i'll be able to do it using HTML code, Please give me a sample code for that... looking forward for your usefull code
Html
:48:44 PM Author : SAMSUNG --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...; <head> <meta http-equiv="Content-Type" content="text/html
Html
:48:44 PM Author : SAMSUNG --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...; <head> <meta http-equiv="Content-Type" content="text/html
HTML
where i can store in the database SEND ME THE CODE FOR THIS IN JAVA AND HTML
Html
Html  in html form for the address by using input as textarea i am writing the code as <tr> <td valign="top"><strong>Address: </strong></td> <td><textarea name="Address" rows="8
html
html   HTML document with Javascript to count the number of vowels in a text typed in text area. please send the code.   Hi Ravi Here... HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD>
Html
Html  can we send data from one html page to another html page? if yes how?   Yes, using javascript. 1)page1.html: <html> <form type=get action="page2.html"> <table> <tr> <td>First Name
HTML
it shows as null. here is the html code for date of birth: <tr> <
HTML
HTML       HTML is used for creating the web pages on Internet. HTML.... If you have to create a website you have to use the HTML for creating pages
HTML
HTML - Hypertext markup language tutorials Learn HTML with the help of many examples. We have created many easy to understand HTML examples. These examples will help you in understanding HTML very quickly HTML is used to create web
HTML markup
HTML markup  What is contained in HTML markup
HTML and DHTML
HTML and DHTML  Compare HTML and DHTML
<html:html locale="true">
;%@ taglib uri="/tags/struts-html" prefix="html" %> <%@ taglib uri="/tags/struts-logic" prefix="logic" %> <html:html locale="true"> <...; <html:base/> </head> <body bgcolor="white">
HTML in the box
HTML in the box  Can I use any HTML in the box
html tags
html tags  html tags   Java Struts HTML Tags
BODY in HTML
BODY in HTML  What is BODY in HTML document
validating a HTML
validating a HTML  What are the reasons for validating a HTML
HTML frames
HTML frames  Are there any problems with using frames
HEAD in HTML
HEAD in HTML  What is HEAD in HTML document

Ads