File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

what is the equivalent code on jsp?

Myel Gregory
Greenhorn

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
Marshal

Joined: Jan 10, 2002
Posts: 60773
    
  65

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?
 
Similar Threads
Multiple form values validation
javascript validation
javascript to jsp?
Accessing invisible checkbox parameter
facing problem while submitting