HTML input in Hindi or other non-english languages (Mostly Indian)

varun1505 picture varun1505 · Apr 1, 2014 · Viewed 7.6k times · Source

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.

Answer

sublime picture sublime · Apr 1, 2014

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.