Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a question

Status
Not open for further replies.

Maximus007

Technical User
Jul 26, 2004
248
US
I have an input box where the user enters his/her email address. If this user doesn't close that web browser! How can I prevent them from typing over their e-mail address again? Isn't there a way if they've used it before and wants the use it again all they have to do is double click and their email address should appear? Is it through the cookies if it. how can get it to work. I tried and had no success.

code:

<%
Dim strEmail

strEmail = request.Cookies("prefs")("Email")
Response.Cookies("Email").Expires = "Jan 1, 2010"
%>

<input type="text" name="Email" size="32" value="<%=strEmail%>">
 
in order to keep them from typing over it :

<%
If strEmail <> "" then StrDisable = " Disabled"
%>
<input type="text" name="Email" size="32" value="<%=strEmail%>"<%=strDisabled%>>

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
 
<%
If strEmail <> "" then StrDisabled = " Disabled"
%>
<input type="text" name="Email" size="32" value="<%=strEmail%>"<%=strDisabled%>>
 
thanks for catching that :)

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
 
Drex;

Thank you very much because it writes the cookie! The only concern I have is the following. When I double click on the input box type the same e-mail address. it's not showing a drop down with the email address. Example on the with the same e-mail it's not giving or showing

code:
<html>
<%
Dim strEmail

strEmail = Request.Cookies("SavedLogin")("Email")

%>
<%
dim StrDisabled
If strEmail <> "" then StrDisabled = "Disabled"

%>
<input type="text" name="Email" value ="<%=strEmail%>"<%=strDisabled%> size="23">
 
Why do you want to prevent them from altering the email address? What if they make a mistake? You can disable this with some clientside js script.



Bastien

Cat, the other other white meat
 
all I would like to do is to prevent the user from retyping their e-mail address again. Example if I previously entered
myemail@mns.com. I were to go back to the site again and as soon as I enter "m " in that input box the rest of my email should appear at the buttom.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top