jQuery in Action, 3rd edition
The moose likes JSP and the fly likes what is the equivalent code on jsp? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » JSP
Reply locked New topic

what is the equivalent code on jsp?

Myel Gregory

Joined: Jul 07, 2011
Posts: 2
i have a javascript code i want it on jsp can someone help me? my code is

var user = document.getElementById("username").value;

var pw1 = document.getElementById("password").value;
var pw2 = document.getElementById("password2").value;

if (user == '' || pw1 == '') {
document.getElementById("username").value = 'Please enter a username.';
document.getElementById("test").style.visibility = 'hidden';
document.getElementById("username").style.visibility = 'visible';
document.getElementById("test2").value = 'Please enter a password.';
document.getElementById("test2").style.visibility = 'visible';
return false;
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63349

Please do not post the same question more than once.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: what is the equivalent code on jsp?
It's not a secret anymore!