Textarea can't use Enter key to wrap
Textarea can't use Enter key to wrap
m2163926
Posts: 5Questions: 1Answers: 0
Why textarea can't use Enter key to wrap
This question has accepted answers - jump to:
This discussion has been closed.
Answers
You are going to have to give us more information because hitting the enter key in a textarea will give you a hard line break.
How does this relate to DataTables?
I know textarea in browser can give a hard line break.
But I use DataTables fields textarea it don't give me hard line break.
I disable js it can give me a hard line break so I don't know why.
This html is my test sample.
https://jsbin.com/rijozizoqi/edit?html,output
Thanks - you are correct! The error is in the following block of code in Editor:
A short term fix would be:
I think there is probably a better way, so I'm going to look into it further. But that's a workaround.
Allan
Yup - here is a better way - it uses the
canReturnSubmit
plug-in method from the fields which will check what return should do:To be in the next version of Editor!
Allan
Sorry what is the namespace?
Is .dt?
And what is the that?
Is that = editor?
Is my code wrong?
Ah yes - that code I posted above needs to go into Editor itself. As I mentioned:
That is the block that the above would replace.
Regards,
Allan
Multi-line textarea data has caused xss validation warning when trying to delete a row. I could "turn off" microsoft's xss validation via web.config but that is overkill.
If anyone else is experiencing the above pain (most likely just my setup) this may help:
Hi Allan,
thanks for the answer, though I can't locate where to apply the fix as the dataTables.editor file is minified.
Can you pls help ?
thanks,
Laurent
You'd need the licensed version to apply the fix as the demo is obfuscated.
Allan
I should say that we are working on 1.8 at the moment which will contain the fix.
Allan
Understood. Buying Editor was definitely in my todo anyhow Such a great package!
Laurent
multi line entry into textboxes with enter key is now working without using a workaround in 1.8. However still need workaround for System.Web.HttpRequestValidationException: 'A potentially dangerous Request.Form value was detected from the client.
Use
UnvalidatedRequestValues
rather thanRequest.Form
. See the MSDN documentation here.Allan
Thank you Allan. That is one way (also heaps easy) and so is the web.config change.
My 'preSubmit' code snippet above worked for one page but not for another, so I did the following hack. However will now look into unvalidatedrequestvalues and "promise"