text input field size

text input field size

LapointeLapointe Posts: 430Questions: 81Answers: 4

Hello
Setting size in text field attr does nothing on editor form..
How to limit displayed length of input field as defined size ?

Else, is there a way to define default return action in editor size to goto next input in the form (like tab key) ?

Thanks for advance

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @Lapointe ,

    You can use maxlength as in this example - see the age field.

    Cheers,

    Colin

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Thanks
    maxlength limit number of characters, but do not set the input size in the form...
    a text field (255) is shown as big as a text field (5).
    input size attribut set the input length, not the maxlength, but does not work in edit form.

  • allanallan Posts: 61,669Questions: 1Answers: 10,096 Site admin
    Answer ✓

    The visible width of the input element is defined by CSS. You could use, e.g, the following to override for a specific field:

    #DTE_Field_age {
      width: 50px;
    }
    

    Here is Colin's example with that addition: http://live.datatables.net/batavisa/2/edit

    Allan

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Hello Allan, Colin
    Exact. Colin did give me this example but I don't remember the field was displayed so small...
    Thanks again

  • erdal.keleserdal.keles Posts: 1Questions: 0Answers: 0
    edited January 2021

    Hello,

    { "label": "Duyuru Tipi:", "name": "duyuru_tipi", "type": "select", "def": "Metin", "options": [ "Metin", "Link" ], attr: { style:"width:175px" } },

    attr: { style:"width:175px" } add .js field and all style use ;)

This discussion has been closed.