By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,098 Members | 1,950 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,098 IT Pros & Developers. It's quick & easy.

To restrict "pasting" data on a text-field.

P: 10
Hi ,

Is it possible to restrict "pasting" any data in a text box,through keyboard(Ctrl-p) and through mouse??Can anybody help in dis

WarmRegards
jk
Jan 9 '08 #1
Share this Question
Share on Google+
7 Replies


gits
Expert Mod 5K+
P: 5,332
hi ...

besides that is a bad idea spoken in terms of usability ... you may handle the key-events and the oncontextmenu event for this purpose ...

kind regards
Jan 9 '08 #2

P: 10
hi ...

besides that is a bad idea spoken in terms of usability ... you may handle the key-events and the oncontextmenu event for this purpose ...

kind regards
hi,

Actually itz a calendar field.So calendar is placed near to the textbox,so use can chose de date from it.So dere z no need for pasting any data,know?
tatz y i askd..


jk
Jan 9 '08 #3

gits
Expert Mod 5K+
P: 5,332
but should he be able to write it in? ... in case he shouldn't then simply set the readonly-attribute to that node ...

kind regards
Jan 9 '08 #4

P: 10
but should he be able to write it in? ... in case he shouldn't then simply set the readonly-attribute to that node ...

kind regards
no! he cant write in it!but,if the user has once entered the date through calendar and then he want to clear it..he cant delete know,if v gv readonly for tat attribute?
Jan 9 '08 #5

gits
Expert Mod 5K+
P: 5,332
you could add a clear button or something like that. what does ... 'if v gv' ... mean?

kind regards
Jan 9 '08 #6

P: 10
you could add a clear button or something like that. what does ... 'if v gv' ... mean?

kind regards
ok....i mean "if we give"...sorry!!
from now onwards wont use any short forms..:-)
if a text field is set a disabled="true" in jsp,later
can we clear that textfield using any function in js ?
Jan 9 '08 #7

gits
Expert Mod 5K+
P: 5,332
of course .... you may set the value to an empty one:

Expand|Select|Wrap|Line Numbers
  1. text_node_ref.value = '';
kind regards
Jan 10 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.