Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. JavaScript
  4. Setting max length property of masked input control in ember js

Setting max length property of masked input control in ember js

Scheduled Pinned Locked Moved JavaScript
javascriptdatabaseregexhelpquestion
2 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    simpledeveloper
    wrote on last edited by
    #1

    input component in ember as below:

    {{#each tags as |tag index|~}}
    * {{yield tag}}
    {{#if _isRemoveButtonVisible}}

            {{/if}}
        
    {{~/each~}}
    
    *           {{masked-input
            disabled=readOnly    
            class=(concat 'emberTagInput-input js-ember-tag-input-new' (if readOnly ' is-disabled'))
            maxlength='20'
            textMaxLength='20'
            placeholder=placeholder
            input-format='regex'
            input-filter='\[A-Za-z0-9\\ \\-@#\]{1,20}'
            input-filter-message='Complaint Id is not valid.'
            }}
    

    And I am using it in my hbs files as below:

            Complaint Id
            {{#tag-input
            maxlength=20
            tags=tags
            addTag=(action 'addNewTag')
            removeTagAtIndex=(action 'removeTagAtIndex')
            as |tag|
            }}
            {{tag}}
            {{/tag-input}}
    

    I want to set max length for the input that I enter as text in the textbox that comes with this component, any help please which property sets the max length that one can enter in it? Thanks a lot please.

    Z 1 Reply Last reply
    0
    • S simpledeveloper

      input component in ember as below:

      {{#each tags as |tag index|~}}
      * {{yield tag}}
      {{#if _isRemoveButtonVisible}}

              {{/if}}
          
      {{~/each~}}
      
      *           {{masked-input
              disabled=readOnly    
              class=(concat 'emberTagInput-input js-ember-tag-input-new' (if readOnly ' is-disabled'))
              maxlength='20'
              textMaxLength='20'
              placeholder=placeholder
              input-format='regex'
              input-filter='\[A-Za-z0-9\\ \\-@#\]{1,20}'
              input-filter-message='Complaint Id is not valid.'
              }}
      

      And I am using it in my hbs files as below:

              Complaint Id
              {{#tag-input
              maxlength=20
              tags=tags
              addTag=(action 'addNewTag')
              removeTagAtIndex=(action 'removeTagAtIndex')
              as |tag|
              }}
              {{tag}}
              {{/tag-input}}
      

      I want to set max length for the input that I enter as text in the textbox that comes with this component, any help please which property sets the max length that one can enter in it? Thanks a lot please.

      Z Offline
      Z Offline
      ZurdoDev
      wrote on last edited by
      #2

      I see you have several attempts. Are they not working? Built-in Components - Components - Ember Guides[^] It's the standard maxlength attribute.

      Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups