Forcing the user to type

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Shelly

    #1

    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

  • Marian Heddesheimer

    #2
    Re: Forcing the user to type

    On 25 Dec 2005 08:52:50 -0800, Shelly wrote:
    [color=blue]
    >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.[/color]

    You should seek JavaScript tutorials how to capture and check
    keystrokes from the user.
    [color=blue]
    >How can I do this?[/color]

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

    Marian

    --

    Online Courses for Everybody

    Comment

    • Peter Fox

      #3
      Re: Forcing the user to type

      Following on from Shelly's message. . .[color=blue]
      >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?[/color]
      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
      peterfox@eminen t.demon.co.uk.n ot.this.bit.no. html
      2 Tees Close, Witham, Essex.
      Gravity beer in Essex <http://www.eminent.dem on.co.uk>

      Comment

      • Janwillem Borleffs

        #4
        Re: Forcing the user to type

        Shelly wrote:[color=blue]
        > 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?
        >[/color]

        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="confirmem ail" onpaste="return false" />


        JW


        Comment

        • Shelly

          #5
          Re: Forcing the user to type

          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.

          Comment

          • Shelly

            #6
            Re: Forcing the user to type

            I stuck that in to my control definition and it worked. Thanks.

            Comment

            • Shelly

              #7
              Re: Forcing the user to type

              I stuck that in to my control definition and it worked. Thanks.

              Comment

              • Jerry Stuckle

                #8
                Re: Forcing the user to type

                Shelly wrote:[color=blue]
                > I stuck that in to my control definition and it worked. Thanks.
                >[/color]

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

                --
                =============== ===
                Remove the "x" from my email address
                Jerry Stuckle
                JDS Computer Training Corp.
                jstucklex@attgl obal.net
                =============== ===

                Comment

                • Keios

                  #9
                  Re: Forcing the user to type

                  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?

                  Comment

                  • Paxton

                    #10
                    Re: Forcing the user to type


                    Shelly wrote:[color=blue]
                    > 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[/color]

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

                    /P.

                    Comment

                    • Shelly

                      #11
                      Re: Forcing the user to type

                      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

                      Comment

                      • Keios

                        #12
                        Re: Forcing the user to type

                        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.

                        Comment

                        • Chung Leong

                          #13
                          Re: Forcing the user to type

                          Jerry Stuckle wrote:[color=blue]
                          > Shelly wrote:[color=green]
                          > > I stuck that in to my control definition and it worked. Thanks.
                          > >[/color]
                          >
                          > Try turning javascript off. You'll find it doesn't work.[/color]

                          My solution to that is usually:

                          <noscript>

                          You must turn on Javascript.

                          </noscript>

                          Comment

                          • Nicholas Sherlock

                            #14
                            Re: Forcing the user to type

                            Chung Leong wrote:[color=blue]
                            > Jerry Stuckle wrote:[color=green]
                            >> Shelly wrote:[color=darkred]
                            >>> I stuck that in to my control definition and it worked. Thanks.
                            >>>[/color]
                            >> Try turning javascript off. You'll find it doesn't work.[/color]
                            >
                            > My solution to that is usually:
                            >
                            > <noscript>
                            >
                            > You must turn on Javascript.
                            >
                            > </noscript>[/color]

                            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

                            Comment

                            • Jerry Stuckle

                              #15
                              Re: Forcing the user to type

                              Chung Leong wrote:[color=blue]
                              > Jerry Stuckle wrote:
                              >[color=green]
                              >>Shelly wrote:
                              >>[color=darkred]
                              >>>I stuck that in to my control definition and it worked. Thanks.
                              >>>[/color]
                              >>
                              >>Try turning javascript off. You'll find it doesn't work.[/color]
                              >
                              >
                              > My solution to that is usually:
                              >
                              > <noscript>
                              >
                              > You must turn on Javascript.
                              >
                              > </noscript>
                              >[/color]

                              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.
                              jstucklex@attgl obal.net
                              =============== ===

                              Comment

                              Working...