-
Sep 27th, 2017, 05:16 PM
#1
Thread Starter
Fanatic Member
[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
-
Sep 27th, 2017, 06:24 PM
#2
Re: length problem using <input tag
Originally Posted by Code Dummy
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.
-
Sep 27th, 2017, 07:13 PM
#3
Thread Starter
Fanatic Member
Re: length problem using <input tag
Neither maxlength nor length works for either one
-
Sep 27th, 2017, 07:15 PM
#4
Re: length problem using <input tag
Originally Posted by Code Dummy
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.
-
Sep 27th, 2017, 07:27 PM
#5
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
-
Sep 27th, 2017, 08:51 PM
#6
Thread Starter
Fanatic Member
Re: length problem using <input tag
Originally Posted by PlausiblyDamp
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
-
Mar 23rd, 2019, 09:31 PM
#7
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|