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



Home Answers Viewqa JSP-Servlet Array problem

Have Programming Question? Ask it here!
 
 
 


Ragavendran
Array problem
1 Answer(s)      4 years and 8 months ago
Posted in : JSP-Servlet



Advertisement
View Answers

November 19, 2009 at 3:27 PM


Hi Friend,

Try it:

<%@ page import="java.sql.*" %>
<html>
<head>
<script type="text/javascript">
function trim(stringToTrim) {
return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function validate(){
var emp_value ="";
for (var i=0; i <document.employee.empid.length; i++){
if (document.employee.empid[i].checked){
var emp_value = document.employee.empid[i].value;
}
}
if (document.employee.empid.checked){
var emp_value = document.employee.empid.value;
}
if(emp_value=="" || emp_value==null){
alert("Please select Employee Id");
return false;
}
else{
alert("Hello");
return true;
}
}
function showEmp(){
if(validate()){
for (var i=0; i <document.employee.empid.length; i++){
if(document.employee.empid[i].checked){
var emp_value = document.employee.empid[i].value;
opener.document.getElementById("emp_id").value=emp_value;
window.close();
}
}
}
}
</script>
</head>
<body>
<form name="employee">
<br><br>
<table width="100%" bgcolor="WHEAT" border=1 cellpadding=5 cellspacing=5>
<tr> <font color="green"> <B>
<TH> CLIENT ID
<TH> CLIENT NAME
</TH>
</b> </font>
</TR>
<%
String id=(String) session.getAttribute("id");
int sumcount=0;
Statement st;
try{
Connection con = null;
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin:@142.1.0.14:1550:bosaix","report","tcs123");
String query = "select ent_Id,ent_Name from entity_master e where ent_type = 'DL'and substr(ent_ctrl_id,1,4)='"+id+"'";
st = con.createStatement();
ResultSet rs = st.executeQuery(query);
while(rs.next()){
%>
<tr><td>
<font color="red"> <B> <input type="radio" name="empid" value="<%=rs.getString(2) %>"><%=rs.getString(1)%> </B> </font></td>
<td> <font color="red"> <B> <%=rs.getString(2)%> </B> </font></td> </tr>
<%
}
}
catch (Exception e) {
e.printStackTrace();
}
%>
<tr><td align="center"> <input type="button" value="Select" onclick="javascript:showEmp();"> </td></tr>
</table>
</form>
</body>
</html>

Thanks


Related Tutorials/Questions & Answers:
array problem
array problem  An integer array a has 19 elements. What is the value of the middle element after the following codes is executed? int i, j,n=19; for (i=0; i for(i=0, j=n-1; i<=j; i++, j--) a[(i+j)/1] -= (a[i]+a[j])/2
Problem in Array
Problem in Array  Hi, Can you help me with this problem? Run a program that check if the input string contains equal number of A's and B's. Hoping for your answer.Thank you.   Here is an example that check
Advertisements
Array /string based problem....
Array /string based problem....  thanx to help me.but again a problem... solve this problem also as soon as possible..... import java.util.*; public class... or char"); char[] array = new char[5]; for(int i=0;i<5;i++){ char ch
string array based problem
string array based problem  R/sir, firstly thanks... sorted value: 11 12 13 3 this is the problem here...... import java.util.*; public... string: "); String[] array = new String[5]; for(int i=0;i<5;i++){ array[i
problem in array if condtion
problem in array if condtion  sir i have prblem in js...i have array... = new Array(); arr[0] = new Array("-select-"); arr[1] = new Array("Maharashtra","Karnataka","Kerela","Rajashthan"); arr[2] = new Array("Texas","New York","Florida
java array problem
java array problem  suppose i have an array a[] at a[0] i have value 5,7 the thing is that i want to assign the value of array a[0]=5,7 to two variable let it be j,k that is j=5 and k=7 plz help regards
array and string based problem
array and string based problem  this program is accepting only..._srt(int array[],int n){ for (int j = 0; j < n; j++){ int i = j-1; int k = array[j]; while ((i>= 0) && (array[i] > k)){ array[i
array and string based problem
array and string based problem  this program is accepting only..._srt(int array[],int n){ for (int j = 0; j < n; j++){ int i = j-1; int k = array[j]; while ((i>= 0) && (array[i] > k)){ array[i
array and string based problem
array and string based problem  this program is accepting only..._srt(int array[],int n){ for (int j = 0; j < n; j++){ int i = j-1; int k = array[j]; while ((i>= 0) && (array[i] > k)){ array[i
Array problem - JSP-Servlet
Array problem  Respected Sir/Madam, I am having a pop up window in which the database values are available.. Its in the format of: One..... Bur my problem is that if the pop up window contains only 1 record
palindrome array problem
palindrome array problem  I'm having trouble figuring this assignment out. Can someone please help me? Generate (write the code) and save in an array Palidrome[250][5] all the 5 letter words using {a, b, c} Write the code
array problem java - Java Beginners
array problem java  PLS HELP ME NOW I NEED YOU RESPONSE IMMDEATLETLY HOPE ITS OK... 1.) Consider the method headings: void funcOne(int[] alpha..., respectively. another problem.,, 2.)Suppose list is an array of five
Facing Problem to insert Multiple Array values in database - JSP-Servlet
Facing Problem to insert Multiple Array values in database  Hai... facing the problem while inserting the data in database. iam using the MsAccess... Manoj   Hi friend, You Have Problem in Data Table and check
in_array
in_array  in_array in php
is _array()
is _array()  is_array() in php   Hi Friend, This function is of Boolean type.It checks whether a variable is an array or not. Here is an example: <?php $yes = array('Hello', 'World'); echo is_array($yes) ? 'Array
is _array()
is _array()  is _array()   Hi Friend, This function is of Boolean type.It checks whether a variable is an array or not. Here is an example: <?php $yes = array('Hello', 'World'); echo is_array($yes) ? 'Array
Array
Array  how can i use elements of an array in a circular form? that is if the searching of the element reach the last elements of the array, then it will start serching from the begining of the array
Array
Array  is it possible to define array like this..? int[] intArray = new int[] {4,5,6,7,8}; Explain...?   Yes, you can. Java Initialize Array
Array
Array  What if i will not declare the limit index of an array, how will I declare an array and store values with it using loop?   Hi Friend...(System.in); int array[]=new int[5]; System.out.println("Enter Array Elements
array
array  write and test a function named mirror that is passed an array of n floats and returns a newly created array that contains those n floats... the array {10.1,11.2,8.3,7.5,22} into{22,7.5,8.3,11.2,10.1
array
array  write and test a function named mirror that is passed an array of n floats and returns a newly created array that contains those n floats... the array {10.1,11.2,8.3,7.5,22} into{22,7.5,8.3,11.2,10.1
array
array  write and test a function named mirror that is passed an array of n floats and returns a newly created array that contains those n floats... the array {10.1,11.2,8.3,7.5,22} into{22,7.5,8.3,11.2,10.1
Array
Array  How do i insert elements into an array up to a limit from...("Enter Range: "); int size=input.nextInt(); int array[]=new int[size]; System.out.println("Enter Array Elements: "); for(int i=0;i<
array
array  WAP in java to store 6 element in array P and 4 element in array Q. Produce the third arra y R containing all element from p & q
array
array  array memory allocation is dynamic or static in java   Java Arrays have dynamic memory allocation
Array
Array  can we create an array of size 1 lakh in java programming
array
accepts a pointer to integer which represents an array of integer.After that this method prints the entire of the array numbers to the monitor. include using std::cout; using std::endl; void printArray(int *array, int count
array
array  take a 2d array and display all its elements in a matrix fome using only one for loop and ple explain the program in below
array
array  create an array in which no element is duplicate. if duplicate then tell to user duplicate. duplicacy is tell to user during when he enter the element
array
array  create an array in which no element is duplicate. if duplicate then tell to user duplicate. duplicacy is tell to user during when he enter the element
array
array  How to store the results of mysql query in an array... qurey in array: "select distinct(EMPLID)from tblwork where EMPLID not in (select... store the result in array
array
array  wap to calculate reverse of 10 elements in an array?  ...++ ) { arr[i]=input.nextInt(); } System.out.print("Array... reversing, Array is: "); for(int i=arr.length-1;i>=0;i
Array's
Array's  I have to finish an "order page". that checks 2 dropdown boxes and a set of radio buttons and put the results into a set of textboxes, 1 line at a time, then calculate a total. I know I need to create an array, but I'm
array
array  Hi i have array like {1,2,3,4,,5,5,6,6} then how can i... is an example that store some integers into an array and find the occurrence of each number from the array. import java.util.*; public class SearchNumberOccurrence
Array
Array  i having problem how to make algorithm for [a][5] [a][10] [b][15] [b][10] [c][5] [c][5] . . . . sum of [a] = 15 [b] = 25 [c] = 10
array
array  how to getting values and storing values in array by using datainputstream?   Hi Friend, Try the following code: import java.io....]=Integer.parseInt(br.readLine()); } System.out.println("Array Elements
Array
reserved. Use a one-dimensional array of primitive type Boolean to represent the seating chart of the cinema theater. Initialize all the elements of the array... the corresponding elements of the array to true to indicate that the seat is no longer
PHP Push Array to Array
PHP Push Array to Array  array_push() function using array in PHP
Create Array ??
Create Array ??   Question in e-clips program: Part 1. Array... stores list of ‚??PhoneEntry‚?? objects. Use an array of size (MAXSIZE = 1000... directory problem defined above. Part 2. Linked List Implementation Create
array example
array example  giving input from outside for array example
Array sort
Array sort  Program that uses a function to sort an array of integers
java array
java array Two cells is a matrix will be called connected if they are adjacent...]. But it will not connected to cell a[1,1] For this problem, lets say, cells denoted by integer...], a[3,2], a[3,3] } elements with weight 6 Problem: Implement Java code which
array of string
array of string  Waht is the problem in this code? import java.util.Scanner; public class LastCheck { public static void main(String args[]){ int a; Scanner s= new Scanner(System.in); a=s.nextInt(); String ar[]=new
length in array
length in array  wat s length in array
array ADT
array ADT  Write a program using array_ADT to retrieve a list of elements from a file
Array of structure
Array of structure  create employment details with necessary field using array of structure
array ADT
array ADT  Write a program using array_ADT to retrieve a list of elements from a file
Java array
Java array   How can one prove that the array is not null but empty
Array Sorter
Array Sorter  I need a program that will ask the user to either "Enter an Array" or to "Exit the program" If the user want to enter an array the are asked to enter ten numbers. Then those ten numbers are stored in an array
Array and input
Array and input  if this is my array int briefcases [ ]={1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26}; i want to ask user to input one of the above numbers then i want to print the array without the number
 

 

 

DMCA.com