This question already has answers here:
Multiple lines of input in <input type="text" />
(10 answers)
Closed 6 years ago.
I've been having a bit of trouble with a problem that seems as though it should be obvious, but my internet searches yield no results. Essentially, I'm trying to create an image-board like HTML skeleton for a project. However, my text entry box (resized to allow for entrance of more than a few words, doesn't allow for entry of more than one line (hitting enter does not start a new line, and arrow keys don't work either.)Keep in mind that I cannot use javascript or any server side languages. What should I do with this?
The id of the textbox is #postbigger - I heard there was a rows style, but upon trying it got no results. Is there some form of css descriptor I can add? ( This is not a duplicate, as I needed to actually apply the code and remove the resizable effect on )
#postbigger {
height:100px;
width:300px;
font-size:14px;
}
<form>
Post:<br><input id="postbigger" type="text"/><br>
Id Code:<br><input type="text"/>
</form>
Use <textarea>
<textarea rows='6' cols='40'></textarea>
Related
This question already has answers here:
How to style text of submit button
(3 answers)
Closed 2 years ago.
We can use the tag(superscript tag) to represent something like a^b and e^x in html5. But while using the tag to make a button, we normally use the 'value' attribute to represent what's gonna be on the button something like this:
<input type="button"class="cutedog" value ="x cube">
But we can't really use the sup tag inside the " " because it just prints out the exact thing out something like this: "e(sup)x(/sup)" (I have deliberately put () instead of < and > because stackoverflow does't support this :( )
Anyway can you tell me that how can we put e^x inside "" or is there any way to do this?? Plz help me :))
<button>x<sup>3</sup></button>
This question already has answers here:
Regular expression for floating point numbers
(20 answers)
Closed 3 years ago.
I need to have a text input that accepts only numbers and the dot sign for float numbers.
I don't want a number type input.
You can't do this with html only - you'd need to use JavaScript.
e.g. Javascript key board input filtering
There is an <input pattern=""> attribute which can be used for validation, but it does not prevent the input from accepting invalid characters, only prevents them being submitted when the form is validated.
This question already has answers here:
Is it guaranteed that non-numeric attribute values on every web-page HTML are always quoted?
(1 answer)
what are data-* HTML attributes?
(1 answer)
Closed 4 years ago.
In the code I am working on I found this:
<div class="icon icon2 screen-icon" data-screen-idx=1>
What puzzles me is the last "attribute" (or whatever it is )
Is this data-screen-idx-1 legal in html tag?
Please note that 1 is not quoted.
If yes, where can I find info about this.
If not, why would someone write such thing?
Yes, this is valid HTML. They are called "data-attributes" and can be whatever you want, as long as they begin with data-.
See this article for more information. MDN - Using data attributes
I'm aware that parsing numbers with pure CSS is impossible. But as in my case I know for certain that the input will always be in a specific way, is it possible to change the display of an input field based on the count of characters in it?
e.G. I want '123450' to be displayed as '1,234.50' - or if it were 'abcdef' it should become 'a,bcd.ef'.
So, I would like a rule that says: from right to left: after the second char display a dot, after the fifth and eight char display a comma.
Is that possible?
Example:
<input type="text" class="unformatted" value="123456" />
Should display like
<input type="text" class="formatted" vaulue="1,234.56" />
while still retaining its original value 123456.
What you're asking is not possible with pure CSS. The smallest you can go with CSS is the single HTML tag, you cannot go deeper than that.
Individual lines of text cannot be selected or altered, as they are seen as a whole by CSS engine.
With a little help from JavaScript, however, this can be easily done.
This question already has answers here:
How do I make JSP tag files NOT ignore all whitespace?
(4 answers)
Closed 8 years ago.
I have one line of html in a form on a JSP page like this:
<c:forEach var="entry" items="${set}">
<input type="checkbox" name="thing" value="${entry.key} ${entry.value}">
</c:forEach>
However, the space between the key and the value ${entry.key} ${entry.value} is lost when the form is submitted. I've tried using a \ before the , in that case both the \ and the are still there when submitting.
It seems that Java EL does not preserve isolated spaces, is that right? If so, is there a valid workaround?
EDIT: This is so silly of me, many thanks to Cthulhu. But I still don't understand the behavior after adding a \. Why would that cause the space to show?
You can insert white-spaces using:
Character Entity References
Edit: Seems to be a bug in the way spaces are handled by the EL parser, so you should use either html entities like or the other ways outlined here.
${entry.key}${' '}${entry.value}
was my way to fix this. Seems a little less verbose than the
<c:out value="${bean.foo} ${bean.bar} ${bean.waa}" />
from the other thread.