dcsimg
Results 1 to 7 of 7

Thread: [RESOLVED] length problem using <input tag

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2017
    Posts
    461

    Resolved [RESOLVED] length problem using <input tag

    I have this html statement:

    <input type="text" id="tb1" length="2000">

    but no matter what value i use for length the length of the input field never changes; it's always a small area and a lot of the text that needs to be displayed is truncated

    How do I make it so the length changes when i use different values.

    Is there a better tag to use instead of this one

  2. #2
    Fanatic Member PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Newport, UK
    Posts
    1,023

    Re: length problem using <input tag

    Quote Originally Posted by Code Dummy View Post
    I have this html statement:

    <input type="text" id="tb1" length="2000">

    but no matter what value i use for length the length of the input field never changes; it's always a small area and a lot of the text that needs to be displayed is truncated

    How do I make it so the length changes when i use different values.

    Is there a better tag to use instead of this one
    Are you trying to control how much screen space the control is using? If so then you really want to be looking at using CSS to handle the position and display of web content. If you are trying to restrict the amount of text then maxlength is the attribute you want, IIRC length isn't a standard attribute for an <INPUT> element.

    If you want to allow a user to enter a large amount of text then a <TEXTAREA> might be a better choice.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2017
    Posts
    461

    Re: length problem using <input tag

    Neither maxlength nor length works for either one

  4. #4
    Fanatic Member PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Newport, UK
    Posts
    1,023

    Re: length problem using <input tag

    Quote Originally Posted by Code Dummy View Post
    Neither maxlength nor length works for either one
    When you say the don't work, what exactly do you mean? What are you expecting them to do and what is actually happening? If you want help with a problem you need to give us something to go on, "it doesn't work" isn't enough.

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    32,261

    Re: length problem using <input tag

    When in doubt, go to the documentation...
    There is a Size and a MaxLength attribute you can use.
    https://www.w3schools.com/html/html_form_attributes.asp

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2017
    Posts
    461

    Re: length problem using <input tag

    Quote Originally Posted by PlausiblyDamp View Post
    When you say the don't work, what exactly do you mean? What are you expecting them to do and what is actually happening? If you want help with a problem you need to give us something to go on, "it doesn't work" isn't enough.
    Sorry, I thought we already established what was meant by my first post and your reply in post #2 that the field wasn't long enough and my text was getting truncated. Anyway, the problem had nothing to do with maxlength or length; it was the SIZE parameter that I needed to use

  7. #7
    New Member
    Join Date
    Mar 2019
    Posts
    1

    Re: [RESOLVED] length problem using <input tag


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width