3

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.

varun1505
  • 800
  • 2
  • 8
  • 16
  • 1
    What does "doesn't work" mean? How do you usually enter Hindi text in other applications? What's the problem? – deceze Apr 01 '14 at 18:36
  • what are you trying to achieve? do you want to see hindi characters as user types with their keyboard? – sublime Apr 01 '14 at 18:48
  • It is an application for a school where the teacher feeds in content. For all subjects it is fine, but for subjects like Hindi and Sanskrit it is not possible to enter in english. Anyways, the answer by @sublime below solves the problem of entering data. – varun1505 Apr 02 '14 at 08:51

2 Answers2

5

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.

sublime
  • 4,013
  • 9
  • 53
  • 92
0

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

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 30 '22 at 08:56