How to add emojis in a textbox in html - html

Hi I want to try and add emojis to my html5 textbox I tried to to something like this <input type="text" emoji> and also like this <input type="emoji"> but it still does not work
if anyone could help that would be great

check this answer here
And if you want to create a box to select the emoji, just use the Emoji-picker.

Another picker is available at https://github.com/DigiLive/EmojiPopper
This one utilizes the popper component of bootstrap 4 without altering/replacing the original html element.

Related

How to have a helper text over the input field in html?

I have the following design:
UI Design
I want an input field like this i.e. having a text like Shipper Name or Contact Number on top of the input field. How can I achieve this in HTML ? I am not able to find it on the internet.
Thank you
you can use material-ui to access these kind of components without having to code it from scratch.
Their TextField looks exactly the same in the image you provided:
https://mui.com/material-ui/react-text-field/
Their documentation you can follow to integrate their library on your project:
https://mui.com/material-ui/getting-started/installation/
Use fieldset and legend
<fieldset><legend>Shipper Name</legend><input type="text"></fieldset>

Make JSF 1.2 render html radio only with SelectOneRadio instead of table elements

When using h:selectOneRadio, JSF is rendering table elements (table, tbody, tr, td) along with it. Is there a way to make JSF render the html radio input and the label only?
I do not want to use tomhawk's layout="spread".
I want to change such behavior for checkboxes also. I guess the only way is to supply a custom renderer. Can someone please guide me how I can create a custom renderer for this?
Tomahawk is open source. Just look in source code of Tomahawk's renderer to learn how to create it yourself.
You can make this
<input type="radio" name="NomPourToutRadio" value="value" />
and recuperate the item selected by
String value = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("NomPourToutRadio")

Put text in textbox

Is there a way to put text in a textbox but also allow the user to type something. I would like to write "username:" inside the box and allow the user to type after the colon. I can do this the hard way by creating a div right next to a textbox and make it look like they are one container, but I was wondering if there was an easier way? Thanks
EDIT: I don't want to text to disappear. I just want to user to be able to continue typing
EDIT 2: the reason you cant put a value in the textbox is because its a form. when the user types a username next to the value it will submit together
HTML5 has a placeholder attribute you can now use:
<input type="text" placeholder="username" />
People have also created javascript functions that mimic this functionality.
There's also a jQuery placeholder plugin which does the same, if you'd like to go that route.
What's wrong with using standard HTML? You don't say that you need it to disappear...
<input type="text" value="username: " />
If you need it to disappear, use a placeholder attribute and a jQuery plugin as a fallback (for the browsers that don't support it.
You could do something like this:
<div>
<label>Username:</label>
<input type="text" />
</div>
CSS
div{border:1px solid gray;}
label{font-family:arial; font-size:.8em;}
input{border:none;}
input:focus{outline:none;}
Basically, created a containing div and placed a label and input in that div. label is the words that stay in the field. input has the border removed.
http://jsfiddle.net/jasongennaro/rZmFx/
Fyi... you may need to increase the size of the input, depending on how many characters you want to accept.
<input type="text" placeholder="Category"/>
Maybe that can help you. If you want the textbox for only read you can put the property readonly = "".
You could call this javascript function once the page is loaded:
function add(text){
var TheTextBox = document.getElementById("Mytextbox");
TheTextBox.value = TheTextBox.value + text;
}
If you are using HTML5, you can use the placeholder attribute.
http://www.w3schools.com/html5/att_input_placeholder.asp

HTML Submit-button: Different value / button-text?

I'd like to create an HTML form submit button with the value 'add tag', however, the web page is in Swedish, so I'd like to have a different button text.
That is, I want to have a button like
but I want to have my code like
if (request.getParameter(cmd).equals("add tag"))
tags.addTag( /*...*/ );
Is this possible? If so, how?
It's possible using the button element.
<button name="name" value="value" type="submit">Sök</button>
From the W3C page on button:
Buttons created with the BUTTON element function just like buttons created with the INPUT element, but they offer richer rendering possibilities: the BUTTON element may have content.
Following the #greg0ire suggestion in comments:
<input type="submit" name="add_tag" value="Lägg till tag" />
In your server side, you'll do something like:
if (request.getParameter("add_tag") != null)
tags.addTag( /*...*/ );
(Since I don't know that language (java?), there may be syntax errors.)
I would prefer the <button> solution, but it doesn't work as expected on IE < 9.
There are plenty of answers here explaining what you could do (I use the different field name one) but the simple (and as-yet unstated) answer to your question is 'no' - you can't have a different text and value using just HTML.
I don't know if I got you right, but, as I understand, you could use an additional hidden field with the value "add tag" and let the button have the desired text.
If you handle "adding tag" via JScript:
<form ...>
<button onclick="...">any text you want</button>
</form>
Or above if handle via page reload

how to add pagination in HTML

I have created one .html page. I have to use pagination in it so that i can avoid scrolling upto last page.and i can move to next page by click on button("Next")
You can create a form like this:
<form action="nextpage.html" method="get">
<input type="submit" value="Next" />
</form>
That will give you a form with a button that redirects the user to the page nextpage.html
Assuming you are looking for a way to implement pagination, take a look at this jquery plugin. And I believe you will find a tons more plugins across the web.
Use Jquery Pager
You can find its Demo here.
You can do that with PHP. With PHP, you can dynamcally generate HTML pages, in this case with a certain amount of items on it and links to the next and previous page.