pattern-matchingopenlaszlolzx

How to include &nbsp in openlaszlo text pattern


I tried this small example which is working fine but i cant give space in between word which is expected.

   <inputtext width="150"
    pattern="[A-Za-z0-9!@:;#$%\^*()_\-\=+/&amp;,./?&lt;&gt;&quot;&apos;{}[]\\|`~ ]*">
    This text is editable.
    </inputtext>

But if i give

pattern="[A-Za-z0-9!@:;#$%\^*()_-\=+/&,./?<>"' {}[]\|`~ ]*"

it is showing error.how to include this space in text pattern.plz help....


Solution

  • You have to use a space character instead of &nbsp; since the space is converted into an &nbsp; only after the text field received the input.

    <canvas>
    
      <inputtext width="150"
        pattern="[A-Za-z0-9 ]*">
        This text is editable.
      </inputtext>
    
    </canvas>