473,473 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Forcing the user to type

I have not been able to find the answer to this on the net.

I want to force the user to type in text into a text field and not be
able to paste in text. This is for confirmation fields.

How can I do this?

Shelly
Happy holidays to all

Dec 25 '05 #1
18 1774
On 25 Dec 2005 08:52:50 -0800, Shelly wrote:
I want to force the user to type in text into a text field and not be
able to paste in text. This is for confirmation fields.
You should seek JavaScript tutorials how to capture and check
keystrokes from the user.
How can I do this?


not with PHP because PHP is a server side language that does not know
if the text was typed or pasted.

Marian

--
http://www.rent-a-tutor.com/wbt/
Online Courses for Everybody
Dec 25 '05 #2
Following on from Shelly's message. . .
I have not been able to find the answer to this on the net.

I want to force the user to type in text into a text field and not be
able to paste in text. This is for confirmation fields.

How can I do this?

Short answer - you can't.

But if you want an e-mail address confirmation
(a) you NEED to confirm another way - i.e. by sending an email to the
address with a secret in it to prove it is alive
(b) you could split the input into two eg
email [....] @ [.....]
confirm [....] @ [.....]
which means /some/ will need typing in again.


--
PETER FOX Not the same since the bra business went bust
pe******@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Dec 25 '05 #3
Shelly wrote:
I want to force the user to type in text into a text field and not be
able to paste in text. This is for confirmation fields.

How can I do this?


Peter's solution would be my first choice, but if you really want to do
this, the only way is JavaScript, e.g.:

<input type="text" name="confirmemail" onpaste="return false" />
JW
Dec 25 '05 #4
I have done no Javascript. I am referencing the confirmemail control
in the submit code as
$_POST['confirmemail']. I need to keep that. Do I simply add
onpaste="return false" to the control? Where to I tell it Javascript,
and still process as php? The rest is all php.

Dec 26 '05 #5
I stuck that in to my control definition and it worked. Thanks.

Dec 26 '05 #6
I stuck that in to my control definition and it worked. Thanks.

Dec 26 '05 #7
Shelly wrote:
I stuck that in to my control definition and it worked. Thanks.


Try turning javascript off. You'll find it doesn't work.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Dec 26 '05 #8
I'm not meaning to be a scrooge the day after Christmas, but I think
the proper question to ask is "Should I" before "Could I". Why would
you want something like this?

Dec 26 '05 #9

Shelly wrote:
I have not been able to find the answer to this on the net.

I want to force the user to type in text into a text field and not be
able to paste in text. This is for confirmation fields.

How can I do this?

Shelly
Happy holidays to all


Please let me paste my passwords/email addresses into form fields. I
HATE having to re-type them.

/P.

Dec 26 '05 #10
That defeats the entire purpose of the confirmation field. If you are
able copy and paste, and the first one has an error, then you have
validated the error.

In the form that I am building, I want to force passwords to be retyped
and email addresses to be retyped. All the other fields can be copied
and pasted from anywhere else. These two fields are far too important
to allow an error to propagate by virtue of user laziness. BTW, I only
disallow the pasting in the confirmation box, so I would half-way
satisfy you.

Shelly

Dec 26 '05 #11
Ah, my bad then. I thought you were using it so a user couldn't copy
and paste a confirmation code out of an email or some such silliness
like that. For those who are less fortunate and have only one monitor,
and let's say that their screen is only a 14" screen.

I know something like that would make me mad, as I've received
confirmation codes in emails that were something close to what seemed
several thousand letters long.

Anyway, that's all I was complaining about. I even type in my email
address and password, and I have the nifty browser plugins that
memorize the stuff for me!

So, happy holidays.

Dec 26 '05 #12
Jerry Stuckle wrote:
Shelly wrote:
I stuck that in to my control definition and it worked. Thanks.


Try turning javascript off. You'll find it doesn't work.


My solution to that is usually:

<noscript>

You must turn on Javascript.

</noscript>

Dec 27 '05 #13
Chung Leong wrote:
Jerry Stuckle wrote:
Shelly wrote:
I stuck that in to my control definition and it worked. Thanks.

Try turning javascript off. You'll find it doesn't work.


My solution to that is usually:

<noscript>

You must turn on Javascript.

</noscript>


Just to force the user to type in something instead of pasting it!? Why
not just let it slide if the user doesn't have Javascript.

Cheers,
Nicholas Sherlock
Dec 27 '05 #14
Chung Leong wrote:
Jerry Stuckle wrote:
Shelly wrote:
I stuck that in to my control definition and it worked. Thanks.


Try turning javascript off. You'll find it doesn't work.

My solution to that is usually:

<noscript>

You must turn on Javascript.

</noscript>


And you've just lost at least one customer - me. I typically surf with
js turned off, and am not going to turn it on to fill in a form.

I know of several other people who feel the same way.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Dec 27 '05 #15
Following on from Jerry Stuckle's message. . .
And you've just lost at least one customer - me. I typically surf with
js turned off, and am not going to turn it on to fill in a form.

I know of several other people who feel the same way.

I agree with you that the OP has lost the plot here. (See my earlier
post) Now making it worse by some demands to DO AS I SAY. Umm.

(1) The OP should
(a) validate email properly not by relying on a re-type and
(b) _supply_ a password.

(2) But hold on a minute Jerry, if you were thinking of trusting the
site to go to the lengths of clicking on a submit button when filling in
one of the OP's forms why would switching on JS be such a big deal? [1]
My reason for bringing this up is that there are some people who rely on
technical fixes to keep them safe rather than the Mk I brain.

[1] Perhaps not everybody has the NoScript extension for Firefox which
gives cool control over this sort of thing. Surely there's nobody out
there who still uses IE?
--
PETER FOX Not the same since the cardboard box company folded
pe******@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Dec 27 '05 #16
Peter Fox wrote:
Following on from Jerry Stuckle's message. . .
And you've just lost at least one customer - me. I typically surf with
js turned off, and am not going to turn it on to fill in a form.

I know of several other people who feel the same way.

I agree with you that the OP has lost the plot here. (See my earlier
post) Now making it worse by some demands to DO AS I SAY. Umm.

(1) The OP should
(a) validate email properly not by relying on a re-type and
(b) _supply_ a password.

(2) But hold on a minute Jerry, if you were thinking of trusting the
site to go to the lengths of clicking on a submit button when filling in
one of the OP's forms why would switching on JS be such a big deal? [1]
My reason for bringing this up is that there are some people who rely on
technical fixes to keep them safe rather than the Mk I brain.

[1] Perhaps not everybody has the NoScript extension for Firefox which
gives cool control over this sort of thing. Surely there's nobody out
there who still uses IE?


Peter,

It has nothing to do with trusting any particular site. I normally surf
with JS off. It's a hassle to have to constantly turn it on for one
page then turn it off again. So when I get to a site which requires
javascript, unless there's a very good reason why I should continue, I
just move on.

There are generally a lot of other sites which don't require javascript
but can fulfill my needs at the time.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Dec 28 '05 #17
Jerry Stuckle wrote:
And you've just lost at least one customer - me. I typically surf with
js turned off, and am not going to turn it on to fill in a form.

I know of several other people who feel the same way.


Not everyone building a web site is a business, my friend. When it's
your government telling you you must have Javascript on, you don't have
much of a choice ;-)

Dec 28 '05 #18
Chung Leong wrote:
Jerry Stuckle wrote:
And you've just lost at least one customer - me. I typically surf with
js turned off, and am not going to turn it on to fill in a form.

I know of several other people who feel the same way.

Not everyone building a web site is a business, my friend. When it's
your government telling you you must have Javascript on, you don't have
much of a choice ;-)


And not everyone who is visiting your site has javascript on.

You may be forced to have javascript on. Others are not. And my
government doesn't tell me I need to have javascript on.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Dec 28 '05 #19

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: D. Alvarado | last post by:
Hello, I have a page that generates a text file (but writes the file with the ".csv" extension) and then I redirect the user so he can save the file header("Location: $my_csv_file"); ...
1
by: ehm | last post by:
I apologize in advance for the cross-post (from microsoft.public.inetexplorer.scripting), but that board seems dead. I have what I think is a fairly simple problem, but I cannot figure this out....
3
by: Julie | last post by:
I have an html file where I display name,address,zip. It is one per line so it is basicall a list of addresses. But I would like ie6 to force the download prompt of this long list of names...
1
by: Just_Buy | last post by:
Environment: MS Access 97 Problem: Trying to force a record to update using the recordset.Update property. What syntax do I need to force a record to be updated? I have searched the...
5
by: David Thielen | last post by:
Hi; We keep having to restart IIS after ASP.NET kills it. Below is what we have in the event log. Any idea what the problem is? thanks - dave Event code: 3003 Event message: A validation...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.