Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet Re: base the value of first combo box, how i display the second combox

Have Programming Question? Ask it here!
 
 
 


Vijay
Re: base the value of first combo box, how i display the second combox
0 Answer(s)      4 years and 5 months ago
Posted in : JSP-Servlet


Dear Sir,
in this program when i click on submit button, the corrosponding value of combo box should be sent. but when i clicked to submit button, it do nothing.
please review this code:


<%
if((school.equals("indus"))||(school.equals("dps"))||(school.equals("mdn")))
{
if(value!=null && (value.equals("result")))
{ %>

<form name="form" >
<table align="center">
<script language="javascript">
function sendData(){
var sch=document.form.school.value;
var cla=document.form.class_name.value;
var y1=document.form.from_year.value;
var y2=document.form.to_year.value;
window.open("logic.jsp?school=<%=school%>&&class_name="+cla+"&&from_year="+y1+"&&to_year="+y2);
}

function hide(){
if (document.getElementById) {
document.getElementById('combo').style.visibility = 'hidden';
}
}

function call(class_name){
var val = class_name.options[class_name.selectedIndex].text;
if((val=='11')||(val=='12')){
document.getElementById('combo').style.visibility = 'visible';
var arr = new Array();
arr[11] = new Array("Art","Commerce","Science");
arr[12] = new Array("Art","Commerce","Science");
var comboValue = class_name.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);
}
}
else{
document.getElementById('combo').style.visibility = 'hidden';
}
}
</script>
<body onload="hide();">

<p></p><br><br><br><br><br><br>
<tr><td style="width: 11px"> <span>Class</td> <td><select name="class_name" onchange="call(this);" >
<%
for( int i=1;i<=12;i++){
%>
<option value="<%=i%>"><%=i%></option>
<%
}
%>
</select><td>
<select id="combo" name="combo2">
</select></td>

<tr><td style="width: 11px"> <span>From Year</td><td><select name="from_year">
<%
for(int j=2000;j<=2010;j++){
%>
<option value="<%=j%>"><%=j%></option>
<%
}
%>
</select></td></tr>
<tr><td style="width: 11px"> <span>To Year</td><td><select name="to_year">
<%
for(int k=2000;k<=2010;k++){
%>
<option value="<%=k%>"><%=k%></option>
<% } %>
</select></td></tr><td></td>
<tr><td style="width: 11px"> <span><input type="button" value="Result" onclick="sendData();"></td></tr>
</table>
</form>
<%
}

}
%>

Advertisement
View Answers

Related Tutorials/Questions & Answers:
base the value of first combo box, how i display the second combox - JSP-Servlet
base the value of first combo box, how i display the second combox    i have a combo box for classes. my requirement is when i select the class, if class is 11 or 12 the second combo box of subject should be appear. please
Re: base the value of first combo box, how i display the second combox - JSP-Servlet
Re: base the value of first combo box, how i display the second combox    thanks for your reply. i want to know suppose the second combo box appear only when i select the class 11th or 12th. please review. your answer
Advertisements
how to get combo box value - JSP-Servlet
how to get combo box value  i have created 1 servlet & 1 jsp page... in combo box in jsp page: (small part of my code) "> now i want the id in servlet page, that i have associated with value i.e "> bcoz i hav
How to retrieve data by using combo box value in jsp? - JSP-Servlet
How to retrieve data by using combo box value in jsp?  For example, In Employee.jsp form, When i click employee id value in combo box...... i already stored combo box values from database. pl
How to retrieve data by using combo box value in jsp? - JSP-Servlet
How to retrieve data by using combo box value in jsp?  I am using a single jsp form.. i did not get from another form.. i do not use 2 jsp form.. all are satisfaction in this form.. What will i do. My code is following
How to retreive data by using combo box value - JSP-Servlet
How to retreive data by using combo box value  Hello friend... I can print combo box values... with html .. So i cannot use request.getParameter. If i am using null value
How to retrieve data using combo box value in jsp? - JSP-Servlet
How to retrieve data using combo box value in jsp?  Hi freind, I already post this question. I need urgent help from u. pl response me.... All actions in the same page.......  Hi Friend, Please visit
How to retreive data by using combo box value - JSP-Servlet
How to retreive data by using combo box value  I am using a single jsp form.. i did not get from another form.. i do not use 2 jsp form.. all are satisfaction in this form.. What will i do. My code is following
how i conditional access the data from database using combo box. - JSP-Servlet
how i conditional access the data from database using combo box.   i have combox box named class when i select its value 11 or 12, another combo box appears named Subject values Arts, Commerce, Science. how i conditional
Combo box value Error - WebSevices
Combo box value Error   if($_SERVER['REQUEST_METHOD'] == 'POST...']); } document.frmProposal.hdVisa.value = document.getElementById('cmbVisa').value; Error: The "cmbVisa" Value is Null,This error will displayed for these coding.So tell me
Store combo box value - Development process
Store combo box value  Hi , this is my code. Here wen i click submit button combo values are stored like 1,2,3... but i want to store value . plz send me code. while validating a form, i have entered data in first field
How to retrieve data from database by using combo box value in jsp? - JSP-Servlet
How to retrieve data from database by using combo box value in jsp?  Hello friend i want use only one jsp page.. but u give 2 pages... I want to work in one page... Pl response.. I do not need getParameter... Pl respose me
How map the first_servlet to second_servlet - JSP-Servlet
How map the first_servlet to second_servlet  Hello, I have two questions. 1.How I want map the second_servlet by first_servlet. My Html page map... have a function which define in second_servlet. How that fuction which define
Code to store sub combo box value - Development process
Code to store sub combo box value  Hi Deepak, In the following code i want to store subcombo box value instead of number. Already "Dkn/Tmz" ,"kungumam... etc are storing but i want to store "Circulation,marketing
How Map the First_Servlet to Second_Servlet - JSP-Servlet
How Map the First_Servlet to Second_Servlet  My Query: Hello Sir, I have two questions. 1.How I want map the second_servlet by first_servlet. My... file. In Jsp have a function which define in second_servlet. How that fuction
combo box - JSP-Servlet
combo box  how to get a combo box in jsp page which allows editing as well as list box
JavaScript Dynamic Combo Box
in respective arrays. As the user selects a country from the first combo box, the cities...: On selecting the value from the first combo, related values will get displayed...JavaScript Dynamic Combo Box Here we are going to create dynamic combo box
populating the combo box - Struts
populating the combo box  Hi I am having problem populating the combo box with a table in MS SQL Server 2005 Management Studio Express. Belo... with the database table. What is the connection string that i am suppose to write
Acees data from database using combo box - JSP-Servlet
Acees data from database using combo box  please let me how i access the data from database when i select combo box combo2 having values Arts, Commerce, Science. this combo box will appear when first combo box class_name having
Need to push the combo box to flash movie - Java Beginners
Need to push the combo box to flash movie   Hi, I need to push the combo box values to the flash movie. I am succusfull in pushing the textfield... the values to push into the flash movie]. Can u advice me how can i acheive
Display two alert box alternately by clicking on text
Display two alert box alternately by clicking on text In this tutorial , we will discuss about how to display two alert box alternately by clicking on text... on it ,it will show a alert box. But when we click on it again , it shows second alert box
JFreeChart- Display coordinate value .
JFreeChart- Display coordinate value .  How to Mark Coordinte value on top of the bar
Sub combo box problem - Development process
Sub combo box problem  Hi, In this code Sub-Combo box is not working. plz solve the problem Search Page var arr = new Array(); arr["Select"] = new Array("-select-"); arr["Dkn/Tmz"] = new Array
Display first letter of every word in uppercase
Display first letter of every word in upper case In this Java tutorial section, you will learn how to display the first letter of every word in uppercase... using the class StringTokenizer. The method token.charAt(0) return the first
Flex ComboBox controls
is any type of event, that show how to access the value of combo box in flex... to access the value of Combo Box.  For Example:- <?xml version="1.0... array collection which is display the month name in combo box. And you can see
Automatically display in text box - JSP-Servlet
Automatically display in text box  Dear Deepak Sir, When i enter some text in text box.That corresponding value in database,the value display in another text box using ajax. Thanks & Regards, VijayaBabu.M
Display values in textbox on selecting checkbox
Display values in textbox on selecting checkbox Here we are going to perform action on selecting the checkbox and display the first five text box values into next five. We have ten text boxes and a checkbox. As the user enters value
Option Box Value - Java Beginners
Option Box Value  Hi Friends, I have one option box which... option box is populated (work schedule,Peronal Area,personal sub area,business..."].options.length=0; for (var i=0;i For the above code we have created
combox validation javascript code - JSP-Servlet
combox validation javascript code  hiiiiiii, I want a javascript code for combobox field validation for my Lotus Notes web page.... thnx ... For More Details Please Click: http://www.roseindia.net/javascript/combo-box
Display current date in text box in JSP using javascript
Display current date in text box in JSP using javascript In this section you will learn how to display current date in text box using JavaScript.For... return months from 0 to 11 therefore we have added 1 to the value return from
JCombo Box problem
JCombo Box problem  I have three combo boxes First combo box display the year Second combo box display the month for the selected year. Third combo box display number of week in a selected month for the year. I am select year
display from select box - JSP-Servlet
display from select box  I am doing a jsp project. In this jsp project i have to show the photos in one cell depending on the selection from other selection box which is in the same page. The photos are stored
JavaScript Checkbox In DropDown box
JavaScript Checkbox In DropDown box In this section, you will learn how to display the checkboxes inside the dropdown box. Now to implement this, we have.... An alert box will display the selected values. Here is the code
PHP List Box Post
The PHP Post List box is used in the form. It contains multiple value User can select one or more values from the PHP list Box This PHP Post List Box is the alternate of Combo box PHP Post List Box Example <?php
To get the value of more than one text box in an HTML page to a jsp page - JSP-Interview Questions
To get the value of more than one text box in an HTML page to a jsp page  An html file has a text box as To get the value of this text box in a JSP... the value of text boxes to a jsp page and how to access the same
two text box problem
two text box problem  i have two text box in two different pages and same variable use in two text box when enter value in first text box it's reflection show in second text box , how i reduce it in jsf ?   Hi Friend
How to find the first 6 characters of string in regex?
How to find the first 6 characters of string in regex?  How to find the first 6 characters of string in regex. I know the Syntax is to String.substring(strtindex, endindex-1) For first six characters is: String
display diffrence between two dates in a text box - JSP-Servlet
display diffrence between two dates in a text box  i have these set...); int days=(int)((ed.getTime()-sd.getTime())/(1000*60*60*24)); // i need to print the days in another text box when i click inside that test box.lease help me
I am getting Undefined in Text Box Very Urgent - JSP-Servlet
I am getting Undefined in Text Box Very Urgent  Respected Sir/Madam... the value "Undefined" in Emp ID text box which is present in the main page.. Here's...+|\s+$/g,""); } function validate() { var emp_value =""; for (var i=0; i <
How to Run First Java Bean Program ?
How to Run First Java Bean Program ?  Hi My Dear Friend I can run... But Now I need that How to run Java Bean Now I have BDK1.1 But still don't know that how run this... I have this bdk dir... \bdk1_1\beans\beanbox
how to display the email message in jsp
how to display the email message in jsp  hi every one .. i am new from this industry please help me to display the email message in jsp page please send me sample code
I want display frame in another frame - Java Beginners
I want display frame in another frame  Hi all, this is available in jsps folder and Admin.jsp is main page i m taking two frame fisrt is header.jsp and another is footer.jsp I want to display footer.jsp is display
how to display the image in center - Ajax
how to display the image in center  i want to dispaly the image as center of the screen using javascript..while i am clicking the button ..any one give me the code for this one
how to display pdf file on browser
how to display pdf file on browser   In my project i have created one pdf file(by pdfwriter) into my local mechine . after that it need to display in browser as a pdf file . but in jsp i can't display by iframe tag can anyone
Java Swing dynamic Combobox
combo boxes. In the first combobox, we have added four items. When the user selects any item from the first combox box, the related data will get appeared...Java Swing dynamic Combobox In this section, you will learn how to display
Find Second Largest Number from an Array
Find Second Largest Number from an Array This section illustrates you how... for the largest one i.e. for the second largest and display it.  Here is the code...]) secondlargest = arr[i]; } System.out.println("Second Largest number
Fancy Box plug-in for Images
Fancy Box plug-in for Images In this section, you will learn how to use fancy box image slider plug-in for image display. This plug in is very easy to use...;elastic' and 'none'(first row of example) .You can set title
How to give the value - JSP-Servlet
How to give the value   How to give the value in following query.. "select * from studentinformation where studentid = '?'"; How to give the value into question mark?...  Hi Friend, Try the following code
Null value when i set interface object in form controller - Spring
Null value when i set interface object in form controller   Hi all, i am very new about spring and hibernate. i got null value when i set...("ohbillManager "+this.ohbillManager); } and another error i unable
Display alert box on clicking link
Display alert box on clicking link In this tutorial, we will display alert box... is used to display alert box on clicking link : $("a").click(function... a "a href" link. On clicking this link ,a alert box prompt message
 

 

 

DMCA.com