Announcement

Collapse
No announcement yet.

Dynamic form: limit field length

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dynamic form: limit field length

    I'm currently working on a dynamic form where an end-user can define his own field, type, default value and length. I managed most of it, but somehow I cannot limit the input length. In effect I would like to get effective:

    Username: <input type="text" name="usrname" maxlength="10">

    I created a javascript procedure with two params:

    var sel = document.F1[fldName]; //get the select field
    sel.maxLength=fldLength;

    But this doesn't work, I tried the ajax varant too without success. Is it possible? Strange thing is that altering width of the editfield itself

    var sel = document.F1[fldName]; //get the select field
    sel.size=fldWidth;

    works

    (It could be that the following is preventing the statement as it is generated within the html page: alt="{datatype: 'text', maxLength: 80, allowedChars: etc"
    Last edited by aducom; 11-22-2014, 08:57 AM.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

  • #2
    Yeah, it seems not to work. Even if you change both, the 'maxlength=' value and the 'maxLength:' value in the 'alt' attribute it is still being ignored and the original values are applied.
    Sorry, don't have a solution yet.

    jsb

    Comment

    Working...
    X