Manage Learn to apply best practices and optimize your operations.

Correcting cut and paste errors from Word

This tip describes how to correct the cut and paste errors that occur in Word.

Have you ever come across the problem; when a user cuts and pastes a document from a "word document" into a TEXTAREA on your notes form, the quotation marks become question marks?
e.g. the user intended "the general" the form created ?the general?

This code when added to the onBlur event of a TEXTAREA will remove that error by converting the bogus ascii codes to ones which are understandable by notes.

add onBlur="RepairPasteFromWord(this)"
 to your TEXTAREA fields.

in the jsHeader
function RepairPasteFromWord(field){

This function corrects the text if it has been 
cut and pasted from word.
Quotation marks do not come through as 
standard character codes and notes 
intpretes them as a ?
"This method will also work for normal 
text fields as well"

var sTemp=field.value
//we are going to replace the 
var sTemp2=escape(sTemp)
//replace front quote mark "
(/%u201C/gi, "%22")
//replace end quote mark "
(/%u201D/gi, "%22")
//replace opening single quote mark '
(/%u2018/gi, "%27")
//replace closing single quote mark '
(/%u2019/gi, "%27")

Dig Deeper on JavaScript for Lotus Notes Domino

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...