Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do i compare value javascript variable with jsp variable

843838Dec 21 2005 — edited Dec 21 2005
I have promblem .I have variable that store store the attribute value of column .The colum has more then one value.How to i compare with javascript value .Currently I am using the following method .
<%String sql_query3 = "SELECT DISTINCT (ir_tran_typ),ir_rea_desc "+
                                          "  FROM intrcd "+
                                          " GROUP BY ir_tran_typ ";
                           System.out.println("trans type"+sql_query3 );            
                            try{
                                rset = db.execSQL(sql_query3);
                            }
                            catch(SQLException e) {
                                System.err.println("Error in query - intrcd - transaction_main.jsp " +e +" sql " +sql_query3);
                            }
                            while(rset.next()== true){
                                tran_cde = rset.getString("ir_tran_typ");
								rea_desc = rset.getString("ir_rea_desc");%>
								<%System.out.println("trans type 34 "+tran_cde );%> 
									//tran_typ = addElement('<%=tran_cde%>');
									
									<% }%>
			    			if(obj.value== '<%=tran_cde%>' ){       
<%  				 		String sql_query2 = "SELECT ir_rea_cde,ir_rea_desc"+
                                          "  FROM intrcd"+
                                          " WHERE ir_tran_typ = '"+tran_cde+"' " +
										  " ORDER BY ir_rea_cde ";
                           System.out.println("trans type"+ tran_cde);            
                            try{
                                rset = db.execSQL(sql_query2);
                            }
                            catch(SQLException e) {
                                System.err.println("Error in query - emmast2 - transaction_main.jsp " +e +" sql " +sql_query2);
                            }
							 index = 1;
                            while(rset.next()== true){%>
                            document.all.rea_cde.options[<%=index%>] = new Option(eval('"<%=rset.getString("ir_rea_cde")%>"'));
                            document.all.rea_cde.options[<%=index%>].value = eval('"<%=rset.getString("ir_rea_cde")%>"');
                            document.all.rea_cde.options[<%=index%>].text = eval('"<%=rset.getString("ir_rea_desc")%>"');
<%                          index++;
							}%>
							
                       
						}
            }
please replay me soon
thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 18 2006
Added on Dec 21 2005
1 comment
267 views