*
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
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
Author

Need help in a JSP page and a Java script

anwaradil adil
Greenhorn

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)

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help in a JSP page and a Java script