No announcement yet.

Can I wrap the text from a select field?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Can I wrap the text from a select field?

    Hi, Here is my problem. I have a control where I am typing in a message. I want to provide a shortcut option for users, so they can optionally select precanned message snippets. I created a shortcuts table and populated it with sentences. I created a select field on my control. It pulls values from the DB table with no problem. I will use ajax to put the selected sentence into an editable field so they can finalize the message.

    That all works no problem. The issue I have is that the sentences are long and it is forcing my whole control to grow super wide. Is there a way to wrap text that is in the selectable options? I can't seem to make this happen.


  • #2
    Bump on this... I still do not see a solution for this. Unless somehow I can force a CSS solution without messing up the rest of the form and fields.


    • #3
      just wondering if it is necessary to show the whole text. Maybe you could provide just a portion of the text, i.e. the first 4 words or so.

      Word word word word ...

      In this case a SQL-statement in the Lookup Settings like this could do it.

      SELECT txt_id, CONCAT(SUPBSTRING_INDEX(txt_text,' ',4),'...')
      FROM txt_table
      ORDER BY txt_text

      Hopefully this is an idea to pursue.



      • #4
        Thank you jsbinca,
        That would work, except that I actually want the user to see the whole long sentence. They are choosing precanned messages, so they have to see the whole thing. The problem is that the stupid strings will only be written by SC as one long line. It blows away all my site CSS and other formating.

        Your idea gave me a thought though... maybe I could somehow cut the string up or embed some sort of formatting in the result kicked back in the select...



        • #5
          Just a thought: how about after every say 20 characters add <br> that out to cause a break.