Announcement

Collapse
No announcement yet.

Controlling input field maxlength at runtime

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

  • Controlling input field maxlength at runtime

    I've been staying up too late....

    Is there any way to code the maxlength value for an input field at runtime from within SC?

    Thanks
    The GuiGuy
    ... from Down Under

  • #2
    Re: Controlling input field maxlength at runtime

    Does 'Field Size in Database' make a difference?
    There is also Maximum Size under Values Format

    If you need to change the length at actual runtime, then I would suggest using JS.

    Regards,
    Scott.

    Comment


    • #3
      Re: Controlling input field maxlength at runtime

      Scott,
      I want to control the maximum input length of a field according to a selection made by the user in a previous (listbox) field. Usually this is done by setting the maxlength parameter on the input field, as in
      <input type="text" name="email" maxlength="35" />

      I was wondering if there was a way to implement this from the SC IDE?
      The GuiGuy
      ... from Down Under

      Comment


      • #4
        Re: Controlling input field maxlength at runtime

        Since SC gens the code, I am not sure you could do this in the IDE, except to put a value/variable in the placeholder for the size value then use JS to find the DOM element and make the changes in code to the document itself.

        You would have to use firebug to get the element info.

        Regards,
        Scott.

        Comment


        • #5
          Re: Controlling input field maxlength at runtime

          [quote author=ScottMartin link=topic=5129.msg13048#msg13048 date=1312983073]
          You would have to use firebug to get the element info.
          [/quote]

          Thanks. The code generator places the literal value declared at design time. Looks like I'll need to get inventive.

          Cheers
          The GuiGuy
          ... from Down Under

          Comment

          Working...
          X