Skip to main content

Hi,

 

I have a form which questions on it where users can copy and paste text into the TEXT AREA.

 

I am now getting reports that all formatting is lost when it is pasted into the Text Area, how can we change this so formatting is retained when pasting into a K2 Text Area?

 

For example, i grabbed some BOLD text in a basic Word Document and copied it, pasting into the K2 area means that the formatting is lost (no bold).

 

How to get round this?

 

Thanks

Good day SharpHarp1


 


Please see the following attached screen shots:


 



 



 



 


 


 


Given you feel that the response is of use or a solution to the issue posted, please mark it as “Mark as solution”, “Kudo” or both options.


 


K2 will not accept any liability for any issues arising from actions taken in respect of the information provided by the forum member.


Kind regards


Thabang


Hi Thabang,

 

Thanks for your response, however you have completely missed the point.

 

I am NOT talking about going into styles and changing the bold/underline AFTER the text has been entered or is about to be entered.....

 

I am talking about pasting in a large piece of text which has already been formatted in MS Word (for example) and is then PASTED into a K2 Text Area, all the formatting is stripped.

 

You can't fix this by going to styles and selecting BOLD for everything. This is a piece of work, some bits are bold, some have superscript, some bits are underlined.

 

So unfortunately your reply is not even to the solution, sorry.


Is it possible to change your Text Area control to a Rich Text control?


If you paste a BOLD piece of text from microsoft word into a Rich Text control, its the same result, formatting is lost

 

Is there a Javscript way to achieve this? Could one of the mods ask Mustafa to see if there is a way?

 

I'm shocked that nobody else has mentioned that such important functionality is missing from K2


 Pasting into Rich Text control keeps the formatting for me, what browser are you using? I've seen some inconsistencies in how browsers handle this, some prompt the user to "clean formatting" or some such, not sure if that is part of the problem here but the Rich Text control *should* work. In fact, what I'm typing into here is the same rich text control and let's see if it keeps bold formatting:

 

Testing something BOLD right here.


Hi,


 


Which K2 version are you using for this environment? There were some issues with older K2 versions when the Rich text control couldn't convert copy/paste from MS Word doc correctly in some cases. 


Alternatively, you can try testing this with Telerik client side editor to see if you are getting the same issue.


 


Hi,

 

Tested with Browser Internet Explorer 11 (our standard browser - so if it doesn't work on this, it's pointless elsewhere)

 

Currently on K2 4.7


Good day Sharpsharp1


 


Doing a quick test with the controls mentioned in this post and the comments, I could see that the Text Area control does not cater for retaining formatting. I do agree with the previous comments made that the Rich Text Control would be the best bet to keep the formatting.


 


I did some testing and confirmed that out of the box on a K5.2 version the rich text control does retain its formatting.



The tests were done on Internet Explorer 11 where the test text was created in a Microsoft Word document, copied from the word document and pasted it into a runtime forms rich text controls and text area control, the formatting was retained.


 


If you do still experience the behaviour where the content does not behave as indicated above, I would recommend logging a support ticket for the issue to be investigated on why it is not retaining the formatting, however keep in mind that this does not seem to be an issue caused from the K2 product but instead might be caused from the browser. When pasting the content to the rich text control I was presented with a browser popup asking "The content you are trying to paste has MS Word formatting. Would you like to clean it?", both option "OK" and "Cancel" seems to have retained the formatting for me on Firefox, Chrome and Internet Explorer however this popup is stating that it is about to execute the browsers OnPaste event which might be stripping out the formatting on browser level. I believe that there is cross-browser support for the OnPaste event, but it is handled differently by browsers. See the onpaste event | paste event reference article for insights.



 


Should you feel that this post is of use and or an accurate solution to the raised question, I kindly encourage you to mark it as such using the 'Mark as Solution', 'Kudo' andor ‘Me Too’ options.


 


Kind Regards


Raymond


 


 


Reply