I have installed fonts of Urdu on server... It is ok for the contents of the website... But there is a problem in getting a user input... it displays English when type in the textbox... So, how will achieve to enable language (Urdu) in textbox...
I am using PHP (Yii framework)... Following is the css...
@font-face {
font-family: nafees;
src: url('font/trado.ttf');
}
.urdu{
font: normal 20pt nafees;
margin-right: 10px;
text-align: center;
direction: rtl;
unicode-bidi: embed;
}
Input to a textbox is defined by the keyboard, not the website. Make sure your keyboard is set to Urdu on your computer, and try again.
The only things you can change about text in a textbox is colour, location, size, as well as funk thinks with javascript.
What is wrong is your input method, client-side, not your code.
This is an OS-specific setting, that the user must set in order to type in another alphabet (and it's sistem-wide, it does not affect only websites).
If the client has not an Urdu keyboard, as you state in a comment, how is he supposed to type in Urdu characters? My only advice would be to open a Character map and selectively choose the glyphs one-by-one, thereby constructing the intended string... somewhat cumbersome.
If the user doesn't have Urde keyboard layout, you can provide two alternative ways to input text in Urdu:
Show a virtual keyboard with Urdu layout.
Use some kind of transliteration service to translate what user inputs to Urdu keyboard layout on the fly.
Edit: here you've an example.
Edit2: another example, it should be easy to copy the .js file to your project and use it for your text inputs :)
Edit3: http://allanguages.info/#layouts= is the webpage of the js library used for virtual keyboard, easy to use and good documentation :D