•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 397,875 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,582 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 1106 | Replies: 1
![]() |
I used this code for validate text box when user paste values to the text box.
It works in other characters but if I paste '£', program did not allow to paste it. How can I solove this problem.
Thanks. :cry:
//Browser Detection
var strUserAgent = navigator.userAgent.toLowerCase();
var isIE = strUserAgent.indexOf("msie") > -1;
var isNS6 = strUserAgent.indexOf("netscape6") > -1;
var isNS4 = !isIE && !isNS6 && parseFloat(navigator.appVersion) < 5;
function Paste(objEvent) {
var objInput;
if (isIE)
{
objInput = objEvent.srcElement;
}
else
{
objInput = objEvent.target;
}
if (!/^[A-Za-z0-9\s\£\$]*$/.test(objInput.value)) {
alert("The character you attempted to used is not allowed for this field.");
objInput.value = objInput.validValue || "";
objInput.focus();
objInput.select();
} else {
objInput.validValue = objInput.value;
}
}
It works in other characters but if I paste '£', program did not allow to paste it. How can I solove this problem.
Thanks. :cry:
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb HTML and CSS Marketplace
- Can't Copy & Paste, or drag & drop in Windows (Windows 9x / Me)
- Cannot paste in forum messages w/ Firefox (Web Browsers)
- JTextpane - cut, copy and paste (Java)
- Copy and Paste not working (Windows NT / 2000 / XP / 2003)
- Takes time to copy,cut,paste or delete (Windows 9x / Me)
- Cannot paste in TechTalk (DaniWeb Community Feedback)
Other Threads in the HTML and CSS Forum
- Previous Thread: Bookmark when closing browser.
- Next Thread: problems aligning lists with CSS


Linear Mode