Page opens like this....
phone:123243453
email:henria@re al.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="VB SCRIPT" CODEPAGE="65001 "%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitl ed Document</title>
<script>
function doSwitch(thePho ne, theMail, theIndex){
document.popped Layer = eval('document. getElementById( "phone"+theInde x)');
document.popped Layer.innerText =thePhone+"**** ";
document.popped Layer = eval('document. getElementById( "email"+theInde x)');
document.popped Layer.innerText =theMail+"@**** ";
}
</script>
</head>
<body>
<%
Dim oconn, rs, sql, tempCount
Set oConn = Server.CreateOb ject("ADODB.Con nection")
Set rs = Server.CreateOb ject("ADODB.Rec ordset")
oConn.Open "Provider=SQLOL EDB; Data Source = Asdaf; Initial Catalog = northwind; Integrated Security = sspi;"
sql = "select phoneno, email from table1"
set rs = Server.CreateOb ject("ADODB.Rec ordset")
set rs = oconn.execute(s ql)
tempCount = 1
Response.Write( "<form name=""myForm"" action=""test.a sp"" 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=""doSwi tch('" & 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>
phone:123243453
email:henria@re al.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="VB SCRIPT" CODEPAGE="65001 "%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitl ed Document</title>
<script>
function doSwitch(thePho ne, theMail, theIndex){
document.popped Layer = eval('document. getElementById( "phone"+theInde x)');
document.popped Layer.innerText =thePhone+"**** ";
document.popped Layer = eval('document. getElementById( "email"+theInde x)');
document.popped Layer.innerText =theMail+"@**** ";
}
</script>
</head>
<body>
<%
Dim oconn, rs, sql, tempCount
Set oConn = Server.CreateOb ject("ADODB.Con nection")
Set rs = Server.CreateOb ject("ADODB.Rec ordset")
oConn.Open "Provider=SQLOL EDB; Data Source = Asdaf; Initial Catalog = northwind; Integrated Security = sspi;"
sql = "select phoneno, email from table1"
set rs = Server.CreateOb ject("ADODB.Rec ordset")
set rs = oconn.execute(s ql)
tempCount = 1
Response.Write( "<form name=""myForm"" action=""test.a sp"" 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=""doSwi tch('" & 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>
Comment