addition of two combobox values using jsp and javascript

addition of two combobox values using jsp and javascript

How to make addition of two combobox values using jsp and javascript?

View Answers

April 4, 2012 at 3:11 PM

<html>
<h2>ComboBox</h2>
<script language="javascript">
var arr = new Array();
arr[0] = new Array("-select-");
arr[1] = new Array("Maharashtra","Karnataka","Kerela","Rajashthan");
arr[2] = new Array("Texas","New York","Florida","California");

function change(combo1)
{
document.getElementById("sel").style.visibility="visible";
var comboValue = combo1.value;
document.forms["form"].elements["combo2"].options.length=0;
for (var i=0;i<arr[comboValue].length;i++)
{
var option = document.createElement("option");
option.setAttribute('value',i+1);
option.innerHTML = arr[comboValue][i];
document.forms["form"].elements["combo2"].appendChild(option);
}
}
</script>
<form name="form" method="post">
<select name="combo1" onchange="change(this);">
<option value="0">-Select-</option>
<option value="1">India</option>
<option value="2">USA</option>
</option>

</select><br />
<select id="sel" name="combo2" style="visibility:hidden;">
</select>
</form>
</html>









Related Tutorials/Questions & Answers:
How to make addition of two combobox values using jsp and javascript?
addition of two combobox values using jsp and javascript  How to make addition of two combobox values using jsp and javascript?  <html> <h2>ComboBox</h2> <script language="javascript"> var arr
How to insert data from a combobox and textbox values into DB using JSP?
How to insert data from a combobox and textbox values into DB using JSP?  hi, How to insert a comb-box and a text box values in to DB using JSP? @DB:student; @table:stu_info; Combobox values:(class1,class2,class3); textbox1
Advertisements
how to generate automatic bill based on selected values using jsp/javascript?
how to generate automatic bill based on selected values using jsp/javascript?  how to generate automatic bill based on selected values using jsp/javascript
Addition of two numbers
Addition of two numbers  addition of two numbers
passing values form javascript - JSP-Interview Questions
passing values form javascript  please i want to pass values from javascript function to jsp code how can i do
two linked combobox
two linked combobox  give jsp example of two combo box when i select state in one combobox in second combo box cities will display according to state which i select
edit values of database using jsp
edit values of database using jsp  hi i want a code to edit the row from tye database and display in a page which containd radio buttons and drop down boxes using jsp code
edit values of database using jsp
edit values of database using jsp  hi i want a code to edit the row from tye database and display in a page which containd radio buttons and drop down boxes using jsp code
how to calculate addition of two distances in feets and inches using objects as functions arguments
how to calculate addition of two distances in feets and inches using objects as functions arguments  how to calculate addition of two distances in feets and inches using objects as functions arguments in java
How to show database values into graph using jsp?
How to show database values into graph using jsp?  How to show database values into graph using jsp
How to show database values into graph using jsp?
How to show database values into graph using jsp?  How to show database values into graph using jsp
values in combobox - Java Beginners
values in combobox  how to fill values in combo box i.e. select tag in html using javascript?   Hi Friend, Try the following code: ComboBox var arr = new Array(); arr[0] = new Array("-select-"); arr[1
to jsp combobox exmple
to jsp combobox exmple  to jsp combobox exmple
Q, 12 WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java
Q, 12 WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java  Q, 12 WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java
WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java
WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java  WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java   
WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java
WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java  WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java   
WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java
WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java  WAP to calculate addition of two distances in feets and inches using objects as functions arguments in java   
count values using jsp - JSP-Servlet
count values using jsp  hai deepak i have a query i am dynamically generating textbox with names in that i am having headings... many subheading like that is it posssible with jsp i think it is possible
Transferring values between javascript and java code in jsp - JSP-Servlet
Transferring values between javascript and java code in jsp  Is there a way to transfer values between the javascripts and the java code(scriptlet...(s); } 2)Pass value from javascript to Jsp scriplet
jsp combobox
jsp combobox  ihave three tables in database country,state and city..if i select one country throug combo box than other combobox show state only select country ...than city how i can implement through jsp   1
how to retrieve data from database using combobox value without using request.getParameter in jsp - JSP-Servlet
how to retrieve data from database using combobox value without using request.getParameter in jsp  Answer pl
do not repeat values in databse during insertion using php and javascript
do not repeat values in databse during insertion using php and javascript  hello all, after tried so much now posting here. i have two programs sql.php and form.jsp. i want to do insert values into mssql database from user input
JSP Value to JavaScript
JSP Value to JavaScript          JSP Value to JavaScript tells you to pass the value from JSP to JavaScript. The JavaScript create a function
Calendar In JSP Using JavaScript
Calendar In JSP Using JavaScript   ... in JSP using JavaScript. We created the following files for the application...:150px;'><a href="javascript:window.close()">Window Close<
Displaying the values in text fields of a form from a javascript function in jsp
Displaying the values in text fields of a form from a javascript function... to call a javascript function by passing 3 values from applet. And i have to display these values in 3 text fields of a form in the current web page. Here form
how to pass form values from javascript of html page to jsp page
how to pass form values from javascript of html page to jsp page   This is my sample html page which contains inline javascript which calculates... to submit all the form values with lattitude and longitude returned from
fill combobox at runtime jsp
fill combobox at runtime jsp  i have 1 combobox in jsp which... another combobox below it, i want it to be filled on the basis of selected value of 1st combobox...plz help with code
how to access element added via javascript dynamically using jsp code
how to access element added via javascript dynamically using jsp code ... javascript dynamically using the jsp code. i am adding empty records on .jsp page using javascript (by calling a below function on click event of button
how to display values from database into table using jsp
how to display values from database into table using jsp  I want to display values from database into table based on condition in query, how... to display books based on either bookname or authorname, for this i created one jsp page
Matrix Addition using RMI in Java
Matrix Addition using RMI in Java  Source Code for Matrix Addition using RMI in Java
javascript for textbox or prompt using servlet - JSP-Servlet
javascript for textbox or prompt using servlet  Dear sir, I am using a prompt(),when a delete is confirmed,its working fine ,but when a prompt is closed or cancel ,i have to remain in the same page but here it is going
how to read values from excel sheet and compare with database using jsp
how to read values from excel sheet and compare with database using jsp  hi sir i am arun how to read values from excel sheet and compare with database using jsp coding i.e, if i have 6(assetid,assetname,serialno,cubical
javascript for textbox or prompt using servlet - JSP-Servlet
javascript for textbox or prompt using servlet  Dear sir I am writing script in servlet,so prompt() is not working here so please help me...In my project when a vendors want to delete the uploaded file
passing rs.getString values between the jsp pages using hidden fields
passing rs.getString values between the jsp pages using hidden fields  I want to pass rs.getString values from 1st.jsp to 2nd.jsp using hidden fields like <input type="hidden" value="<%=rs.getString(1
How to store values in a database using JSTL? - JSP-Servlet
How to store values in a database using JSTL?  I want to store values... extract details and displays in a table format... Now i want to store these values... in database using JSTL name number Position add
Values from servlet into dropdownlist in jsp page using ajax
Values from servlet into dropdownlist in jsp page using ajax  1) jsp...; <script type="text/javascript"></script> <title>Country</title> <script type="text/javascript"> var htmlres; function
Combobox jsp from 0 to 10
Combobox jsp from 0 to 10  Hi guys please help me to write a very easy program using jsp to display value in combobox from 0 to 10. How to write the for loop? Please help.Thank!!!   <html> <select> <
displaying a calendar of only current month in jsp on webpage using javascript
displaying a calendar of only current month in jsp on webpage using javascript  how can we display a calendar of only current month in jsp on webpage using javascript
Email validation is JSP using JavaScript
Email validation is JSP using JavaScript... will show you how to validate email address in you JSP program using JavaScript.... In your JSP program you can use JavaScript to validate the email address
Add and Delete Element Using Javascript in JSP
Add and Delete Element Using Javascript in JSP... developed an application to add and delete element using javascript . We created two...;/form> </BODY> </HTML> In this code having two
coding for horizontal menubar using using html or javascript - JSP-Servlet
coding for horizontal menubar using using html or javascript  hii friends, i wanted to implement horizontal menubar in my project tht wil open the links to diffrnt pages kindly help
How to edit values in textboxes from database using jsp
How to edit values in textboxes from database using jsp  Hi RoseIndia, I need help to solve my technical problem, i want to edit values in textboxes from database table using jsp, here is my code Please can anyone help me
How To Page Refresh Using JavaScript In JSP
How To Page Refresh Using JavaScript In JSP       In this section, we develop an User Login application . We created five file sign.jsp,signout.jsp,user
Passing values in ComboBox from XML file
Passing values in ComboBox from XML file In this tutorial we are going to know how we can pass a values in ComboBox by using XML.  This example... message. As we are inserting the values in the combobox so we are using the <
Insert value of dynamic generated text box in jsp using javascript
Insert value of dynamic generated text box in jsp using javascript  hello sir , i want to generate dynamic text box at run time and i did that using... using for dynamic row generation. <script LANGUAGE="JavaScript"><
How to get the text from textarea in HTML and store it in database using javascript and jsp
How to get the text from textarea in HTML and store it in database using javascript and jsp  How to get the text from textarea in HTML and store it in database using javascript and jsp <script> function str() { <
How to get sub category based on category from database using jsp and javascript.
How to get sub category based on category from database using jsp and javascript.  How to get sub category based on category from database using jsp and javascript
Retain jsp values
Retain jsp values  how to retain a jsp values without using session...() and request.setAttribute() methods to get the jsp fields values. For more information, visit the following links: http://www.roseindia.net/jsp/jsp-get
Addition of two Number in Class
Addition of two Numbers in Class   ... in this program  we are going to use addition of  two number. First of all... two integer type values in the class method. After that we are going to create
retrive values - JSP-Servlet
retrive values  how to get multiple values from html to jsp

Ads