Soo
Soo

Reputation: 397

how can i pass input data of popup box by onclick into jsp?

I want to enter password by onclick of Javascript and then, pass the password value to JSP file to store its Domain.

input id=save type=button onClick="password=prompt('Enter your password');"

How can I pass this password value in pop box to JSP or User Domain ?

Or can I use jquery for this function? Please let me know.

Upvotes: 1

Views: 1182

Answers (1)

stealthyninja
stealthyninja

Reputation: 10371

You could do something like

<input id="save" type="button" onClick="if (pass = prompt('Enter your password')) { $('#password').val(pass); }">

<input type="hidden" name="password" id="password">

Upvotes: 2

Related Questions