Pooya Karimian
Persian Javascript
Persian/Farsi keyboard emulation under IE/Mozilla/Firefox browsers using Javascript.
This code is originally an implementation of National Iranian Keyboard Standard (ISIRI 2901:1994)
from Roozbeh Pournader and
Behdad Esfahbod but I made some changes
to make it work under Firefox/Mozilla browsers too.
It is known to work under Internet Explorer 6.0 in Microsoft Windows
and Mozilla and Firefox browsers in any Unicode supporting OS. This code is licensed under
GNU General Public License.
Please report comments and bugs to info at_pooyak.com.
Try typing in the following textbox. CTRL+ALT changes language and SHIFT+SPACE inserts a Zero-Width-Non-Joiner character:
Update (2013-07-31): Artyom Lukanin, Firefox fix (isTrusted flag)
Update (2006-04-13): initKeyEvent is back in Firefox 1.5.0.2 (Bug #303713).
Update (2005-12-02): I fixed vertical and horizontal scrolling in Firefox=>1.0.6. Although still horizontal scrolling has some small issues it works fine in most of the cases.
Update (2005-09-09): Thanks to Behdad and Artyom Lukanin the script is now working in Firefox => 1.0.6 too.
Update (2005-08-07): Seems like because of a vulnerability initkeyevent is disabled from Firefox 1.0.6 as you can see in bug #289940. I'm too busy but I will try to write a complete description and comment on that bug hoping that this feature returns back to Firefox.
Firefox on Windows up to version 1.0.x has problem with catching CTRL+ALT event. This problem is fixed in the nightly builds coming with Gecko 1.8b. Knowing that it will be fixed in the next Firefox release (1.1.x). I decided to leave the same key combination, because it is the best possible combination possible. You can change the source code to add extra shortcuts.
- isiri2901.zip Package: JS Source with a sample HTML
- isiri2901.js Javascript only
Original code was published on Persian Digital Library and FarsiTools project on SourceForge.
- Iranian Keyboard Layout based on National Iranian Keyboard Standard (ISIRI 2901:1994).Here you can ask your questions and leave your comments about this scripts.
Persian keyboard [Hide]
Salam Pooya, I was wondering if you know of any javascript code that would produce a persian keyboard. Some people were complaining that they either can't type using persian keyboard or don't have it at work. Best, mehdi
Persian keyboard [Hide]
salam pooya jan man ye site mp3 daram ke addressesh ro vared kardam www.mp3-ir.com agar beri tooie site mibini ke paeene page man ye ghesmate news gozashtam age bekham tiooie in farsi benevisam bayad chikar konam? chon vaghty ke az windows baraye in kar estefade mikonam aski code rad mishe
Persian keyboard [Hide]
I saw Behdad's after I saw your javascript. Your draft keyboard looks promising. My knowledge of javascript is not that good. It would be great if you can drop the letters in a box. Best, mehdi
Persian keyboard [Hide]
I am trying to change the language of three text boxes that I have in Submit page of balatarin. The don't have the same ID but I can give them the same Class. How can I use your code to convert all boxes with the same class? Is there a more elegant solution for it? thanks,
FF2.0 compatible [Hide]
I'm very happy to see it works all fine in Firefox 2.0 :-)
Great work! [Hide]
Nicely done. Looking for more great works like this one. It is cool to see folks like you guys come up with solution like this...
Borhan | 2007-07-25 09:24:41 |
type farsi [Hide]
salam man dombale yek barname migardam ke az tarighe oon betoonam farsi type konam va nemidoonam che barmaei ro bayad search konam lotfan mano rahnamai konid
leila | 2007-07-26 03:39:34 |
FireFox Error [Hide]
Ba Salam با سلام این ادیتور فارسی شما در مرورگر فایرفاکس درست کار نمی کند لطفا راهنمایی کنید. ضروری است. با تشکر از زحماتتان Your Farsi editor does not work properly in FireFox Browser? Please Help
Typing farsi on buttons [Hide]
Hi! I am trying to make some buttons with farsi language. I manage to write it but when i want to see the button in different browsers, then the text changes to ?????. Could you please guide me about that if you know about typing farsi in flase, dreamweawer or other tools. with regards Ebi
Ebi | 2007-11-12 17:17:01 |
Typing farsi on buttons [Hide]
I have the same problem, did you decide it?
Faridun | 2012-05-12 05:27:42 |
It doesn't type "Peh" [Hide]
Hi This keyboard doesn't type "Peh" پ of persian alphabet
theone2003a | 2008-01-12 09:22:38 |
Thank and more suggest [Hide]
look at this: http://sourceforge.net/projects/jsvk/ improve this code with GUI with Javascript, it's so usefull. thank and goodluck. \m/
linux [Hide]
با سلام و تشکر از امکان خوبی که ارائه کرده اید من این کد را استفاده کردم و براحتی در محیط سیستم عامل ویندوز مایکروسافت در تمام مرورگرها کار میکند ولی امروز متوجه شدم در سیستم عامل لینوکس کیبرد هیچ تایپی انجام نمیدهد لطفا راهنمائی کنید
hossein | 2008-04-20 02:32:02 |
Arabic keyboard [Hide]
Salam, I want to use ur script in an application that users can enter english & arabic languages. I noticed that the keyboard layout is Iranian and i need it arabic. Can i? How? Example when i press ] i need to get ج in arabic.
Samer Hussein | 2009-02-06 01:36:57 |
linux [Hide]
salam man systeme amelam Linux ast vali na mitavanam farsi bekhanam na benevisam. lotfan agar momkene rahnemaiee konid
Alireza | 2009-03-08 07:13:09 |
Thanks [Hide]
very thanks for interesting codes. i could use from this code but still not implementation it in our site.
Chrome [Hide]
Hi, would you please make this code compatible with Google Chrome, cause this browser is somw how public too and some Users have problems. Regards
Mehrad Mahmoudian | 2009-08-17 06:46:54 |
Thanks [Hide]
very thanks for this kind of code. But I need indian Language Supports like Hindi,Urdu..........other than persian.How can i develop. plese assist me
Labtob [Hide]
متاسفانه این برنامه بر روی لب تاب کار نمی کند من در چند لب تاب مختلف آنرا امتحان کردم و کار نکرد حتی همین صفحه در لب تاب فقط تایپ انگلیسی کار می کند و فارسی را تایپ نمی کند در صورت امکان راهنمایی بفرمایید با تشکر
Davood | 2010-07-19 12:10:57 |
Google Chrom browser [Hide]
با سلام با برسیهایی که انجام دادیم مشکل از لب تاپ نیست. متاسفانه این برنامه در Google Chrom browser کار نمی کند اگر امکان دارد مرا راهنمایی کنید. با تشکر
Davood | 2010-07-20 00:45:43 |
Problem In change textarea to textbox in asp.net [Hide]
سلام و خسته نباشید با تشکر فراون از زحمتی که کشیده ایدو منتشر کردید.من دوتا مشکل داشتم. اول اینکه وقتی به جای textarea, textbox قراردادم برنامه با مشگل مواجه شده و فقط direction تغییر می کند و زبان تغییر نمی کند.حتی کدهای جاوااسکریپت را هم trace کردم با قبل هیج تفاوتی از نظر اجرای کد نداشت ولی در عمل با مشگل مواجه بود. مورد دوم: وقتی که زبان کیبورد فارسی باشد در دو حالت فارسی تایپ می شود یعنی با فشردن لینک انگلیسی و سپس تایپ در منطقه مشخص شده، فارسی تایپ می شود . ممنون از وقتی که می ذارین .
shima sharif | 2011-01-18 00:50:16 |
determine language of keyboard on text box [Hide]
man to web sitam ye textbox daram k karbar mitoone toosh engelisi ya farsi type kone va man mikham k befahmam ba che zabani dare type mikone lotfan komakam konin?
parisa | 2011-05-16 23:06:52 |
Mamnoon [Hide]
Salam mamnoon az in javascript. besyar khoob va perfevt bood,test kardam khieli aali bood. ghorbanat Jalal
Jalal | 2012-02-23 20:41:27 |
تركيب حروف و اعداد [Hide]
سلام ممنمون. وقتي يك متن با تركيب حروف فارسي و انگليسي و عدد را تايپ مي كنيم هنگام خواندن مقدار اين كنترل متن را درست نمي دهد و جاي حروف و اعداد را به هم مي زند. لطفا راهنمايي كنيد. مرسي
R B | 2012-11-12 22:33:35 |
Firefox 18.0.2 [Hide]
Dear Pooya, I am using your Persian Javascript code already for a long time, and it is great! I noticed that the Persian characters do not appear when the latest version of Firefox is used (18.0.2). That's why I am writing this email in English! I wonder if you need to update anything in the code. Will you please have a look? Best regards, Fakhredin Sayed Tabatabaei.
Fakhredin | 2013-02-15 02:06:58 |
عدم کارکرد [Hide]
سلام پویا جان این کد شما توی مرورگر موزیلا در ورژن 19 که جدید ترین میباشد عمل نمیکند لطفا بررسی فرمائید
سعید | 2013-03-18 22:45:09 |
Char Code [Hide]
Hi Pooya, I need farsi char code when i fire up next line in javascript: var Char = String.formCharCode(event.keyCode); Normally this line returns standard char code in English, I need it in farsi. Can you help me?
Faramarz | 2013-07-28 08:35:31 |
IE 11 problem [Hide]
your above sample not working in the IE 11.
Safari / Mac implementation [Hide]
Hello, is there any chance to get this script working on Safari, both for Windows and Mac? If I switch the keyboard to "Persian", it doesn't type anything if opened in Safari. We could pay for this job, if it's possible. Let me know!
thanks [Hide]
thats great. but i have a question. i use this script in reactjs froms.but when i fill a inputs with persian charecter (system language is EN) and fill next form that is in english the persian input disappear.why?
yegane | 2016-11-17 15:02:25 |