• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Pasting by using mouse

 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In JSP I am using Custom Text Tag but I need feature as User can not paste text in that textbox using mouse right click.
Please help me.

Thanks in advance.

Shailesh G. Narkhede
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you don't want people to enter text into a field you can disable it using JavaScript.

I don't understand what right-clicking has to do with it, though.
 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to restrict user to enter text from keyboard only.
Not from the mouse pasting,by right click & select option paste from contextmenu.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd call that user-hostile behavior. What's the difference between entering text by keyboard and entering text by copy-and-paste? Furthermore, what's the difference between copy-and-paste by keyboard and copy-and-paste by mouse?
 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am displaying one small pop up below text box.
Data in pop up is comming from database table accroding to name we typed.
(i am using ajax for that.)I am connection to data base onKeyup.
& if no record found for you typed word then showing alert message as "Invalid name".
this is working for kayboard copy-paste but when i paste any invalid name by using mouse then it not showing alert because it not going to database.

So i want do textbox as only worked for keyboard.pasting by mouse is not paste anything in textbox.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Shailesh Narkhede:
when i paste any invalid name by using mouse then it not showing alert because it not going to database.



i do not know ..whether i am correct or not.eventhough my suggesstion

why can not use onMouseOver [javascript]?
 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But what can we do on mouse over?
 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Shailesh Narkhede:
I am displaying one small pop up below text box.

What do you mean by "pop up"? A select element? If so, please use proper terminology.

I am connection to data base onKeyup ... but when i paste any invalid name by using mouse then it not showing alert because it not going to database.

So rather than trying to find a real solution you think just disabling paste is an acceptable solution?



Why not try to find a real way to solve the problem?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have onfocus() onblur() onchange() events to work with. Some browsers support paste events too.

Eric
 
reply
    Bookmark Topic Watch Topic
  • New Topic