Page opens like this....
phone:123243453
email:henria@real.com
but aftr clicking that button
I need to display like this..
phone:12324****
email:hen***@******
am geting this eror...
Invalid procedure call or argument: 'Left'
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>
function doSwitch(thePhone, theMail, theIndex){
document.poppedLayer = eval('document.getElementById("phone"+theIndex)');
document.poppedLayer.innerText=thePhone+"****";
document.poppedLayer = eval('document.getElementById("email"+theIndex)');
document.poppedLayer.innerText=theMail+"@****";
}
</script>
</head>
<body>
<%
Dim oconn, rs, sql, tempCount
Set oConn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
oConn.Open "Provider=SQLOLEDB; Data Source = Asdaf; Initial Catalog = northwind; Integrated Security = sspi;"
sql = "select phoneno, email from table1"
set rs = Server.CreateObject("ADODB.Recordset")
set rs = oconn.execute(sql)
tempCount = 1
Response.Write("<form name=""myForm"" action=""test.asp"" method=""post""><table id=""myTable""><tr><td>Phone Number</td><td>Email Address</td><td> </td></tr>")
While not rs.EOF
Response.Write("<tr><td id=""phone" & tempCount & """>" & rs.Fields(0) & "</td><td id=""email" & tempCount & """>" & rs.Fields(1) & "</td><td><input type=""button"" onclick=""doSwitch('" & Left(rs.Fields(0), 5) & "','" & Left(rs.Fields(1), InStr(rs.Fields(1), "@")-1) & "','" & tempCount & "')"" value=""Mask""></tr>")
tempCount = tempCount + 1
rs.MoveNext
Wend
Response.Write("</table></form>")
rs.Close
cn.Close
%>
</body>
</html>