473,394 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Is hidden field required..?

23
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...plz suggest??

Expand|Select|Wrap|Line Numbers
  1. vbscript
  2. function getPhone(text)
  3. dim textsize 
  4. textsize = Len(text)
  5. text = Left(text,5)
  6. For index = 0 to textsize
  7. text = text & "*"
  8. Next
  9. getphone = text
  10. End Function
  11.  
  12. Function getEmail(text)
  13. dim textsize
  14. textsize =Len(text)
  15. dim atpos
  16. atpos = instr(text,"@") - 5
  17. text = Left(text,5)
  18. For index = 0 to textsize
  19. if atpos = index+1 then
  20. text = text & "@"
  21. else
  22. text = text & "*"
  23. end if
  24. Next
  25. getemail = text
  26. End Function
  27.  
  28. Set oConn = Server.CreateObject("ADODB.Connection")
  29.       Set oRs = Server.CreateObject("ADODB.Recordset")
  30.       oConn.Open "Provider=SQLOLEDB; Data Source = ria; Initial Catalog = northwind; Integrated Security = sspi;"  
  31.  
  32.  sSql =  "SELECT  phone,email,id FROM tbl1  userid =4 "
  33.   oRs.Open sSql, oConn 
  34.      While not oRs.EOF 
  35. 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>")
  36.        oRs.MoveNext()
  37.     Wend  
  38.     ors.close
  39.     oconn.close  
  40.  
  41. if request.form("submit")="check" then
  42.  
  43. i=1
  44. end if
  45. if  request.form("nameid") <> "" then
  46. set star1 = oConn.Execute("select resid from tbl1 where id= '" &request.form("nameid")&"'")
  47. if not star1.eof then
  48. sl = "UPDATE tbl1 SET star = '" & i & "' where resid= '" &request.form("nameid")&"' and userID = " & userid 
  49. oConn.Execute sl
  50. End if
  51. End if 
  52.  
  53.     %>  
Jan 9 '09 #1
3 1618
Nicodemas
164 Expert 100+
So that I may fully understand the answer you seek, are you saying you want your code to output the phone number and e-mail address in plain text, and then when a user clicks on one or the other it will obfuscate part of the relevant string?

OR, are you asking for the reverse scenario where the relevant strings are obfuscated and need to be clicked on to remove the stars?
Jan 9 '09 #2
sureshl
23
want my code to output the phone number and e-mail address in plain text, and then when a user clicks on one or the other it will obfuscate part of the relevant string......

Page should open like ..
21323
dsad@dsa.com
check (button) aftr clicking

then
213***
ds**@*****
Jan 9 '09 #3
Nicodemas
164 Expert 100+
I would suggest a JavaScript solution instead of an ASP solution. I suggest this because the answer you seek is only for an update to the Document Object Model.

An ASP solution for what you are asking would require a full HTTP Request/Response cycle to complete the process. The ASP is much slower than using JavaScript would be; and, the ASP solution would cause more server overhead.

Go to the JavaScript forum and ask the experts there the following question, and provide them with the following sample code:

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?

Expand|Select|Wrap|Line Numbers
  1. <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> 
  2.  
By the way, I found an error in your code. Modify line 35 of your code below to this. You didn't close a TD tag properly.
Expand|Select|Wrap|Line Numbers
  1. 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>") 
Jan 9 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Randell D. | last post by:
Folks, Perhaps someone can figure this out - this is 'the process of my script' I have a form whereby I can add multiple contacts to a single address. There is only one...
1
by: mark.reichman | last post by:
First off.. Thanks to Grant Wagner for help in a previous thread related to this one. I am at a total loss... I have multiple fields in a form with the same name. Lets call the fields with the...
13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
3
by: Roy Adams | last post by:
Hi I'm reposting this question because for some reason can't post follow up question to this thread. What I'm trying to do is put the value and text from a a select in to a text field and to a...
1
by: tllcll | last post by:
Hi, I would like to find out how to handle the following: I retrieve the data from the database by calling javabean and return the data back to the same jsp page and then display those values...
351
by: CBFalconer | last post by:
We often find hidden, and totally unnecessary, assumptions being made in code. The following leans heavily on one particular example, which happens to be in C. However similar things can (and...
2
by: Bill Steele | last post by:
I want to have a window pop up with a form. When the form is submitted, it needs to pass along the URL of the original window. If find on th web eight gazillion descriptions of how to pass data...
8
by: =?Utf-8?B?cGVsZWdrMQ==?= | last post by:
i have a GridView and a hidden field : <asp:TemplateField Visible=false > <ItemTemplate > <asp:HiddenField Value="<%#Eval("isActive")%>" id="hidIsActive" runat=server /> </ItemTemplate>...
1
by: mark | last post by:
Forgive me if this seems like a stupid question but I need help... I'm trying to do a simple online form that emails me the results from a few fields. Here is the code: <form...
1
by: jamestpaul | last post by:
I'm having some difficulty with Safari users and hidden fields in my .NET 2 asp application. There is a hidden field that gets loaded with the contents of a div in my form. When the user submits...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.