on 01-01-2008 7:13 AM
Dear Experts,
I have a JSP form and on click of the submit i call a Java script. In the javascript i call a method in a bean (and pass string parameters) which would return me boolean value. Now On click of submit in the Javascript i'm able to call the bean method and pass hardcoded values successfully. But i'm not able to pass to the bean thee form input field values as parameter. I was able to get the form value in a variable say Var Str1, but not able to pass 'Str1' to the bean as parameter.
<%
boolean statuschk = test123.checkuserid("JOHN","johnpass");
%> ---> This code is working good.
<%
boolean statuschk = test123.checkuserid(document.loginForm.j_user.value,document.loginForm.j_password.value);
%> --> This is Not Working
var Str1 = document.loginForm.j_user.value;
var Str2 = document.loginForm.j_password.value;
<%
boolean statuschk = test123.checkuserid(Str1,Str2)%> --> This is also Not Working
Points will surely be awarded.
Hello,
To my knowledge you are mixing client side scripting(javascript/vbscript) and server side scripting (JSP/ASP/PHP). To pass the parameters to JSP or Java Bean. you need to make use of Request.getParameter("<parametername>"); This statement will return the paramater value submited. Please make sure you submit the page.
Let me know, how it goes
HTH
Vivek Nidhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.