Book Section
-----
TY JavaScript 3rd Ed.
Teach Yourself JS 1.5
Teach Yourself DHTML
Teach Yourself JS 1.3
LLWW: JavaScript

General Section
-----
Discussion Forum
Articles / Tips
JavaScript Links
About the Author
Privacy Policy
Contact Me



Other Sites
-----
Website Workshop
JavaScript Weblog

JavaScript Workshop Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
how JSP codes residing in js function works

 
Post new topic   Reply to topic    JSWorkshop Forum Index -> Server-Side Languages
View previous topic :: View next topic  
Author Message
tllcll
New member
New member


Joined: 27 Aug 2005
Posts: 9

PostPosted: Sat Aug 27, 2005 2:06 am    Post subject: how JSP codes residing in js function works Reply with quote

Hi,

I would like to check with you how JSP codes residing in js function works.

How can I get the 2nd select stmt executed based on the values retrieve from 1st select statement and the conditions pass in to this js function

How can I get the select statement to execute only when a condition is met.

The following is the codes. It is not executing the 2nd select statement. when I didnt put in the 2nd select stmt, i manage to execute codes in that portion

script
====
function test(obj, obj2) {
<%
sql_query = "SELECT a1, a2 , a3, a4, a5 "+
" FROM table_a ";
try {
rset = db.execSQL(sql_query);
}
catch(SQLException e){
System.err.println ("Error in query " +e);
}
%>

var po_ln_fnd = false

<% while (rset.next()) {
j_a1 = rset.getString("a1");
j_a2 = rset.getString("a2");
j_a3 = rset.getString("a3");

%>

if ((eval(obj2.value)== '<%=j_a1%>')) {
if ((obj.value == '<%=j_a2%>') ) {
<% j_a4 = rset.getString("a4");
j_a5 = rset.getString("a5");

sql_query = "SELECT b2, b3, b4 "+
" FROM table_b "+
" WHERE b1 = '"+j_a3+"' ";
try {
rset = db.execSQL(sql_query);
}
catch (SQLException e) {
System.err.println("Error in query " +e);
}
while (rset.next()) {
j_b2 = rset.getString("j_b2");
j_b3 = rset.getString("j_b3");
j_b4 = rset.getString("j_b4");
}
%>
}
}
<%}>
}
________
Mercedes-Benz O370
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    JSWorkshop Forum Index -> Server-Side Languages All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
(c) 1997-2002 Starling Technologies and Michael Moncur. Portions (c) Sams Publishing.