• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Peter Rooke
Bartenders:

assign var to java variable

 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Is it possible that i can assign the var value from the javascript to a java string variable???

<script>
function myfunction(value)
{
var password = value
}

//calling a method: checkuser(username,password);

the reason why i'm trying to this is coz i have a secure form, and i want the user to enter his password before he can submit the page.
I'm prompting the user to enter his password using javascript interactive dialog box.
The password that the user enter goes to the function myfunction(value) and it is this value that i want to supply to my java method.

Right now, i;m storing the value in a hidden field and submitting the page and then checking for validity, but it would be really cool if any one can help me out for cancelling the submit if wrong password is supplied.

All i want is how to pass the var value to java variable..!! Is it possible???

Thanxs in advance
 
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rekha Pande:

Is it possible???



Short answer: No.
For explantion search this forum (and the JSP forum as well).
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you use Ajax, it is possible.

Eric
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic