Domanda

I want to take user input in Hindi in a HTML form. How do i go about it?

I tried setting the font-family for the <input /> to some hindi font. But that doesn't work. Is there any other way of doing it?

Even embedding Google Transliterate or something similar will do. But i need to store the data entered into a MySQL Database.

PS: I am using PHP to do the server side stuff.

È stato utile?

Soluzione

Although from your question it's not clear what you are trying to do. But for the sake of this answer I'm going to assume that you want users to see hindi characters as they type with their keyboard. In that case changing font is not going to help. Changing font has nothing to do with what characters you type on keyboard and what characters you see on screen.

If you want to let users type hindi character with their QUERTY keyboard then you need to embed something like google transliterate.

Here is the developers documentation on how to do it

https://developers.google.com/transliterate/v1/getting_started

Hope it helps.

Altri suggerimenti

Just download a Hindi font and change the input field font family to a Hindi font name.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top