I have a text box in chat . when i am sending long sentences in just keep on taking the text to right and letting me add more text. I want to wrap the text when it reaches the end of the text box…
please let me know how can i do
Following is the code snippet:
<%= submit "Send Message", class: "btn btn-primary2 btn-small" %>
</form>
<%= if get_flash(@conn, :error_m) do %>
<div class='text-red'><%= get_flash(@conn, :error_m) %></div>
<% end %>
<div class='text-notice text-grey'>Note: You must refresh this page to see new messages.</div>
</div>
<input type="text"> cannot be multi line. Only <textarea> can be. Automatic wrapping of text / resizing of the textarea for the available text is something you need javascript for. HTML doesn’t do that for you.
But i am not able to give attribute rows with text area:
<%= textarea f, :body, placeholder: “Start typing to send message”, required: true, rows:“5” %>
Probably, still it was a tip for the OP to not only show code thats not working but the error as well. In this case its pretty obvious but there are cases when its not and the error message helps a lot.
actually i tried using html_opts then i replaced with opts:
following is the error with this code :
<%= textarea f, :body, placeholder: “Start typing to send message” ,html_opts: [rows: 5, required: true]%>
lists in Phoenix.HTML and templates may only contain integers representing bytes, binaries or other lists, got invalid entry: {:rows, 5}