'Does a textbox in CkEditor 5 have to be MultiLine?

I have a simple test page with a textbox and a button in ASP.Net. If I do not put TextMode="MultiLine" in the element, no value is returned to the code behind. If I DO put it in, I get a value.

This is the ASPX:

<script src="ckeditor/ckeditor.js"></script>
<asp:TextBox ID="txtarea2" runat="server" ClientIDMode="Static" TextMode="MultiLine"></asp:TextBox>
        <script type="text/javascript" lang="javascript">
            ClassicEditor.create(document.querySelector('#txtarea2'));
        </script>
 <asp:Button ID="submitButton2" runat="server" Text="Button" />

This is the codebehind:

Protected Sub submitButton2_Click(sender As Object, e As EventArgs) Handles submitButton2.Click
        Dim joe As String = txtarea2.Text
End Sub

If I use MultiLine, in debug, the txtarea2.Text shows that it has the value entered in the text box. If I do NOT use MultiLine, in debug the txtarea2.Text is empty.

This isn't a big problem in my case, but it took me about an hour to figure this out.

I don't see anything on the web that says ckeditor 5 textbox must be MultiLine.

Any thoughts on this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source