browse: forums | FAQ
Connecting Tech Pros Worldwide

Hey there! Do you need JavaScript / Ajax / DHTML help?

Get answers from our community of JavaScript / Ajax / DHTML experts on BYTES! It's free.

Stopping user from pasting into a text box

Astra
Guest
 
Posts: n/a
#1: Dec 21 '05
Hi All

I know this might sound weird, but I have a form where I ask the user to
enter their email address in one text box and then again in a confirm email
text box to make sure that they have entered it correctly.

My problem is that many users appear to type their email address in the
first box and then copy and paste it into the 2nd box.

If they typed it incorrectly the first time then all they have done is
confirmed that it is wrong.

Is there anyway that I can stop them pasting into the confirm email text box
so that they have to type it twice?

Thanks

Robbie





Duncan Booth
Guest
 
Posts: n/a
#2: Dec 21 '05

re: Stopping user from pasting into a text box


Astra wrote:
[color=blue]
> Hi All
>
> I know this might sound weird, but I have a form where I ask the user
> to enter their email address in one text box and then again in a
> confirm email text box to make sure that they have entered it
> correctly.
>
> My problem is that many users appear to type their email address in
> the first box and then copy and paste it into the 2nd box.
>
> If they typed it incorrectly the first time then all they have done is
> confirmed that it is wrong.
>
> Is there anyway that I can stop them pasting into the confirm email
> text box so that they have to type it twice?
>[/color]
You could put the second box onto the response page from submitting the
original form. That way your users don't know that they have to enter a
second copy until its too late to copy the original but users of Google's
autofill can still repeat it with a single click.

If you mask it as a request for confirmation of acceptance of T&C you might
even manage to avoid irritating them too much.

Alternatively just use the single copy of the email address to send an
email which the user has to respond to to confirm their details. You'll
have to do that anyway before you can trust the email they entered so
getting them to enter a duplicate isn't actually very useful anyway.
John Bokma
Guest
 
Posts: n/a
#3: Dec 21 '05

re: Stopping user from pasting into a text box


"Astra" <No@Spam.com> wrote:
[color=blue]
> Hi All
>
> I know this might sound weird, but I have a form where I ask the user
> to enter their email address in one text box and then again in a
> confirm email text box to make sure that they have entered it
> correctly.
>
> My problem is that many users appear to type their email address in
> the first box and then copy and paste it into the 2nd box.[/color]

Preventing copy paste, if possible, is a no no.

You can make the second box 2 boxes, and put an @ in the middle between
them and ask them to enter in the box (2a) to enter the part in front of
the @, and in the second one (2b) the part after it.

I do the copy/paste myself, since it's my problem if I do it wrong, not
yours ;-) And you certainly shouldn't cripple my browser to correct me.

--
John Perl SEO tools: http://johnbokma.com/perl/
or have them custom made
Experienced (web) developer: http://castleamber.com/
Charles Sweeney
Guest
 
Posts: n/a
#4: Dec 21 '05

re: Stopping user from pasting into a text box


John Bokma wrote
[color=blue]
> "Astra" <No@Spam.com> wrote:
>[color=green]
>> Hi All
>>
>> I know this might sound weird, but I have a form where I ask the user
>> to enter their email address in one text box and then again in a
>> confirm email text box to make sure that they have entered it
>> correctly.
>>
>> My problem is that many users appear to type their email address in
>> the first box and then copy and paste it into the 2nd box.[/color]
>
> Preventing copy paste, if possible, is a no no.
>
> You can make the second box 2 boxes, and put an @ in the middle[/color]
between[color=blue]
> them and ask them to enter in the box (2a) to enter the part in front[/color]
of[color=blue]
> the @, and in the second one (2b) the part after it.[/color]

That sounds like a good solution to the guy's problem.
[color=blue]
>
> I do the copy/paste myself, since it's my problem if I do it wrong,[/color]
not[color=blue]
> yours ;-) And you certainly shouldn't cripple my browser to correct[/color]
me.

I usually retype it. I want to be sure myself that it's right!

--
Charles Sweeney
http://CharlesSweeney.com
John Bokma
Guest
 
Posts: n/a
#5: Dec 21 '05

re: Stopping user from pasting into a text box


Charles Sweeney <me@charlessweeney.com> wrote:
[color=blue]
> John Bokma wrote
>[color=green]
>> "Astra" <No@Spam.com> wrote:
>>[color=darkred]
>>> Hi All
>>>
>>> I know this might sound weird, but I have a form where I ask the user
>>> to enter their email address in one text box and then again in a
>>> confirm email text box to make sure that they have entered it
>>> correctly.
>>>
>>> My problem is that many users appear to type their email address in
>>> the first box and then copy and paste it into the 2nd box.[/color]
>>
>> Preventing copy paste, if possible, is a no no.
>>
>> You can make the second box 2 boxes, and put an @ in the middle[/color]
> between[color=green]
>> them and ask them to enter in the box (2a) to enter the part in front[/color]
> of[color=green]
>> the @, and in the second one (2b) the part after it.[/color]
>
> That sounds like a good solution to the guy's problem.[/color]

Thanks :-)
[color=blue][color=green]
>> I do the copy/paste myself, since it's my problem if I do it wrong,[/color]
> not[color=green]
>> yours ;-) And you certainly shouldn't cripple my browser to correct[/color]
> me.
>
> I usually retype it. I want to be sure myself that it's right![/color]

IIRC you only accept a few things in front of the @ ? I still accept
anything, because I often invent email addresses (well, the part in front
of the @) to track stuff.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Charles Sweeney
Guest
 
Posts: n/a
#6: Dec 21 '05

re: Stopping user from pasting into a text box


John Bokma wrote
[color=blue]
> Charles Sweeney <me@charlessweeney.com> wrote:[color=green]
>> I usually retype it. I want to be sure myself that it's right![/color]
>
> IIRC you only accept a few things in front of the @ ? I still accept
> anything, because I often invent email addresses (well, the part in
> front of the @) to track stuff.[/color]

I accept everything too. I retype it to make sure the whole thing is
correct. One can't rule-out a typo!

--
Charles Sweeney
http://CharlesSweeney.com
John Bokma
Guest
 
Posts: n/a
#7: Dec 21 '05

re: Stopping user from pasting into a text box


Charles Sweeney <me@charlessweeney.com> wrote:
[color=blue]
> John Bokma wrote
>[color=green]
>> Charles Sweeney <me@charlessweeney.com> wrote:[color=darkred]
>>> I usually retype it. I want to be sure myself that it's right![/color]
>>
>> IIRC you only accept a few things in front of the @ ? I still accept
>> anything, because I often invent email addresses (well, the part in
>> front of the @) to track stuff.[/color]
>
> I accept everything too. I retype it to make sure the whole thing is
> correct. One can't rule-out a typo![/color]

True, and it wouldn't be the first time it happens to me. Oh, I also copy
and paste the password, which is probably worse since there is no real
feedback (other then *******).

--
John Perl SEO tools: http://johnbokma.com/perl/
or have them custom made
Experienced (web) developer: http://castleamber.com/
ned
Guest
 
Posts: n/a
#8: Dec 21 '05

re: Stopping user from pasting into a text box



"Astra" <No@Spam.com> wrote in message
news:11qird2jf29js76@corp.supernews.com...[color=blue]
> Hi All
>
> I know this might sound weird, but I have a form where I ask the[/color]
user to[color=blue]
> enter their email address in one text box and then again in a[/color]
confirm email[color=blue]
> text box to make sure that they have entered it correctly.
>
> My problem is that many users appear to type their email address in[/color]
the[color=blue]
> first box and then copy and paste it into the 2nd box.
>
> If they typed it incorrectly the first time then all they have done[/color]
is[color=blue]
> confirmed that it is wrong.
>
> Is there anyway that I can stop them pasting into the confirm email[/color]
text box[color=blue]
> so that they have to type it twice?[/color]

......... I hope not, because I never type my e-mail address at any
time!
I have it permanently stored so that it is a two key copy every
time, - like a stored signature.

--
ned

http://www.bugsandweeds.co.uk
last update 12.12.2005


mouseit101@gmail.com
Guest
 
Posts: n/a
#9: Dec 21 '05

re: Stopping user from pasting into a text box


you can change a boolean called editable that afects whether they can
write in it or not

Blinky the Shark
Guest
 
Posts: n/a
#10: Dec 22 '05

re: Stopping user from pasting into a text box


John Bokma wrote:
[color=blue]
> Charles Sweeney <me@charlessweeney.com> wrote:
>[color=green]
>> John Bokma wrote
>>[color=darkred]
>>> Charles Sweeney <me@charlessweeney.com> wrote:
>>>> I usually retype it. I want to be sure myself that it's right!
>>>
>>> IIRC you only accept a few things in front of the @ ? I still accept
>>> anything, because I often invent email addresses (well, the part in
>>> front of the @) to track stuff.[/color]
>>
>> I accept everything too. I retype it to make sure the whole thing is
>> correct. One can't rule-out a typo![/color]
>
> True, and it wouldn't be the first time it happens to me. Oh, I also
> copy and paste the password, which is probably worse since there is no
> real feedback (other then *******).[/color]

I was configuring some software yesterday and was asked if I wanted
passwords to be represented by 1. one asterisk per character, 2. three
asterisks per character, or 3. nothing. I'd never run across such a
choice anywhere.


--
Blinky
Killfiling all posts from Google Groups
http://blinkynet.net/comp/uip5.html

bwucke@gmail.com
Guest
 
Posts: n/a
#11: Dec 22 '05

re: Stopping user from pasting into a text box


[color=blue][color=green]
> > I usually retype it. I want to be sure myself that it's right![/color]
>
> IIRC you only accept a few things in front of the @ ?[/color]

And overzealous scripts prevent me from using firstname.secondname@,
myemail+sortmark@gmail.com, company-name@, under_score@ and usually end
up with disabling javascript altogether or going to the competition.

"Your second name is too short. Second name should be at least 4
characters long."
Real error message.
Better risk some incorrect input than prevent users from entering
legtimate stuff.

bwucke@gmail.com
Guest
 
Posts: n/a
#12: Dec 22 '05

re: Stopping user from pasting into a text box


One idea, approach from a different side.
onSelect="this.selection.empty();" in the first textbox - this way they
won't be able to copy the data in the first place.

Norman L. DeForest
Guest
 
Posts: n/a
#13: Dec 22 '05

re: Stopping user from pasting into a text box



On 22 Dec 2005 bwucke@gmail.com wrote:
[color=blue][color=green][color=darkred]
> > > I usually retype it. I want to be sure myself that it's right![/color]
> >
> > IIRC you only accept a few things in front of the @ ?[/color]
>
> And overzealous scripts prevent me from using firstname.secondname@,
> myemail+sortmark@gmail.com, company-name@, under_score@ and usually end
> up with disabling javascript altogether or going to the competition.
>
> "Your second name is too short. Second name should be at least 4
> characters long."
> Real error message.
> Better risk some incorrect input than prevent users from entering
> legtimate stuff.[/color]

You think you have problems. I know someone woth only *one* name.
*Every* form he fills out that wants a name complains about the
alleged "missing" half of the name (no matter which half he fills out).

The first computer problem I had was to figure out how to modify a
TRS-80 BASIC accounting program (which used PEEK and POKE all over the
place to insert machine code to do half of its work and handle half of its
logic) because the program sold to him as allegedly being usable in Canada
insisted on US addresses (with legitimate US State abbreviations) for all
employees and *that* part of the program was to be used for printing
addressed payroll checques for mailing.

(Then there's all the spam I get to my Canadian address with offers
"for US residents only". **sheesh**)

--
Norman De Forest http://www.chebucto.ns.ca/~af380/Profile.html
af380@chebucto.ns.ca [=||=] (At the Sign of the Flashing Cursor)
"Oh how I miss the days when it was easier to catch gonorhea than a
computer virus." -- Big Will in alt.comp.virus, March 9, 2005

Closed Thread