JavaScript Experts,
I have the following HTML. How could I use JavaScript such that when a user clicks on the checkbox in each row the phone numbers and e-mail addresses are partially obfuscated with asterisks?
Dis question is asked to forwarded to javascript ... By Nicodemas in above format...
Am facing a problem, with this script...
I want two fields to be written by star , in order to hide . and this script does it , but ,
wat actually is my page opens directly with star letter , rather i need to open my page with the phoneno and email aftr clicking the button i want to make a change to the star to the respective fields ..........
How can i do this...
Page should open like ..
21323
dsad@dsa.com
check (button) aftr clicking
then
213***
ds**@*****
I have the following HTML. How could I use JavaScript such that when a user clicks on the checkbox in each row the phone numbers and e-mail addresses are partially obfuscated with asterisks?
Code:
<table><tr><form method='post'><td>phone:</td><td>21323</td><td width='10%' align='right'>mail:</td><td>bob@example.com</td><input name='submit' type='submit' value='check'><input type='hidden' name='nameid' value='6' ></form></tr></table>
Am facing a problem, with this script...
I want two fields to be written by star , in order to hide . and this script does it , but ,
wat actually is my page opens directly with star letter , rather i need to open my page with the phoneno and email aftr clicking the button i want to make a change to the star to the respective fields ..........
How can i do this...
Page should open like ..
21323
dsad@dsa.com
check (button) aftr clicking
then
213***
ds**@*****
Code:
vbscript function getPhone(text) dim textsize textsize = Len(text) text = Left(text,5) For index = 0 to textsize text = text & "*" Next getphone = text End Function Function getEmail(text) dim textsize textsize =Len(text) dim atpos atpos = instr(text,"@") - 5 text = Left(text,5) For index = 0 to textsize if atpos = index+1 then text = text & "@" else text = text & "*" end if Next getemail = text End Function Set oConn = Server.CreateObject("ADODB.Connection") Set oRs = Server.CreateObject("ADODB.Recordset") oConn.Open "Provider=SQLOLEDB; Data Source = ria; Initial Catalog = northwind; Integrated Security = sspi;" sSql = "SELECT phone,email,id FROM tbl1 userid =4 " oRs.Open sSql, oConn While not oRs.EOF Response.write("<table><tr><form method='post'><td >phone : </td><td>"&getPhone(ors(0))&"</td><td width='10%'align='right'mail :</td><td>"&getEmail(ors(1))&"</td><input name='submit' type='submit' value='check'><input type='hidden' name='nameid' value='" & ors(2) & "' ></form></tr></table>") oRs.MoveNext() Wend ors.close oconn.close if request.form("submit")="check" then i=1 end if if request.form("nameid") <> "" then set star1 = oConn.Execute("select resid from tbl1 where id= '" &request.form("nameid")&"'") if not star1.eof then sl = "UPDATE tbl1 SET star = '" & i & "' where resid= '" &request.form("nameid")&"' and userID = " & userid oConn.Execute sl End if End if %>
Comment