Originally posted by kapil java:
i write one jsp in that i used one combo box and selecting value from combo which i take in reg_form1.hdnCustType.value form now i want to use this value in jsp
pl.help
Originally posted by kapil java:
i am gouing to show u code
1>
String sql= " select GNPM_ID, GNPM_DSCRPTN from GN_PRDCT_MSTR where GNPM_ID IN ( SELECT GNCPM_GNPM_ID FROM GN_CTGRY_PRDCT_MSTR where GNCPM_GNCCM_ID="that java script varaible value which is dynamic)";
- Varun
Originally posted by Varun Khanna:
Where are you executing this SQL statement?
In the same JSP where your javascript variable is present? :roll:
Originally posted by kapil java:
in same jsp one value i have to select from combo ok.then on click i call one function in that function i write one (jsp) sql in that query i want to take value from that combo and depending on that value i want to fetch record which i want to populet.(same page)all dynamically..
pl.reply
- Varun
Originally posted by Varun Khanna:
- So you are having a SQL query string in the Javascript function.
- And you are picking the value of the combo and appending it in the SQL string.
(something like
var sql ="Select ......." + document.formname.comboname.value + "...");
- Now you are passing the "sql" query value to the server (may be through some hidden variable) and executing it in server .
thanks varun so what is solution for it?how i amm using that script value in sql query?
pl. reply
- Displaying the result back in JSP.
That helped?
P.S. Do remember that the Javascript code is executed at the client side and Java code at the server side.
[ March 04, 2004: Message edited by: Varun Khanna ]
Originally posted by kapil java:
thanks varun so what is solution for it?how i amm using that script value in sql query?or never?
pl. reply
- Varun
Originally posted by Varun Khanna:
- So you are having a SQL query string in the Javascript function.
- And you are picking the value of the combo and appending it in the SQL string.
(something like
var sql ="Select ......." + document.formname.comboname.value + "...");
- Now you are passing the "sql" query value to the server (may be through some hidden variable) and executing it in server .
thanks varun so what is solution for it?how i amm using that script value in sql query?
pl. reply
- Displaying the result back in JSP.
That helped?
P.S. Do remember that the Javascript code is executed at the client side and Java code at the server side.
[ March 04, 2004: Message edited by: Varun Khanna ]
for (int i = today; i < endOfTime; i++) { code(); }
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
| Don't get me started about those stupid light bulbs. |