This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Need help in a JSP page and a Java script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Need help in a JSP page and a Java script" Watch "Need help in a JSP page and a Java script" New topic

Need help in a JSP page and a Java script

anwaradil adil

Joined: Apr 12, 2010
Posts: 1
Hello ,

I am struck with the script , I have to hide/mask SSN(a number or string) .I should only be displaying last four digits of that number.

<html:text property="ssn1" styleClass="clsForm" maxlength="3" size="3" uppercase="true" onkeyup="javascript:autoTab(this, 3, event);if(value.length==2){ssn2.focus();mask(this)}"/> 

please note its not a <input> tag its <html:text> and the value is displayed from database we are not entering it and value is read only.I want to know If I am calling mask(this) from correct place. I do not see any thing reflected on the page even after I have written the following java script

java script

function mask(obj) {
var a=’’;
var len = obj.value.length;
for(var i=0,;i<len;i++) {
a += "x";

obj.value = a;
can somebody correct this java script . if numbers are like 123456789 then i should display them as *****6789 (only last four visible)

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Need help in a JSP page and a Java script
It's not a secret anymore!