When to copy a multiple lines of value from Notepad or Excel and paste them to to the text box in Enhanced Search Widget, Chrome, Edge and Firefox all can handle it well and work charmingly. However the user prefers IE and IE can only take the first line of values. Any suggestion to fix this? Many thanks.
Solved! Go to Solution.
Hi Liang Jiang,
You more or less answer the question by posing it. You mention several modern browsers who handle the pasting of multiple lines of value very well.
If the user chooses to stick with good "old" Internet Explorer, he/she should accept the limitations of this application...
HTH,
Egge-Jan
Hi Liang Jiang,
You more or less answer the question by posing it. You mention several modern browsers who handle the pasting of multiple lines of value very well.
If the user chooses to stick with good "old" Internet Explorer, he/she should accept the limitations of this application...
HTH,
Egge-Jan
You are right. Sometime it is better to convince the users to give up IE.
If you think my answer is right, you might mark it as the correct one 🙂
I poke around. Brandon Pugh post a solution and code in his blog
https://www.brandonpugh.com/blog/2011/10/allow-pasting-multiple-lines-in-ie-textbox/
if (window.clipboardData) {
$('#textboxId').bind('paste', function (e) {
var clipped = window.clipboardData.getData('Text');
clipped = clipped.replace(/(\r\n|\n|\r)/gm, " "); //replace newlines with spaces
$(this).val(clipped);
return false; //cancel the pasting event
});
}
Time to digest the Enhanced Search Widget and inject the code above.
Hi Liang Jiang,
No, I do not agree 🙂 With this code - written ages ago - you do not paste multiple lines in the IE text box. Instead you convert a multi line string in a single line string before pasting it..... And this would only be necessary for IE, because modern browsers do not mind pasting multi line strings. So this would require an additional check, to see what browser is being used.
Again: I would suggest to forget about Internet Explorer altogether 🙂
Egge-Jan
User likes the convenience to copy multiple rows of parcel number from excel.
Microsoft should update their IE for the IE lovers.