|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
How to make an extended character inserter for a form?
Afternoon all,
I've written a web editor system for my database, using php to process form data. However, I need to be able to enter extended unicode characters. At the moment I've got a list of the more commonly used ones in a table, and just cut'n'paste them when I want to enter them into my textbox/input fields. Problem: this is time consuming. Question: Any other ways to do this? I've thought about using, say something like: 1 = 'U+00D5' 2 = 'U+00D6' etc, and use php/python to translate them later, but with 20+ characters this would quickly get confusing. My second idea is to use something like the forum smilies thing on my right here. where if I click a smily face it inserts ' ' (ie ':' + ')' ) into the textbox. How is this done? I'm assuming javascript - but as I don't know javascript (& have tried to avoid it in the past, but I'm willing to bite the bullet and learn some). Any ideas or suggestions? Cheers, Simon (Posted here because I'm not sure where else to put it.) |
|
#2
|
||||
|
||||
|
ok. Looking through various forums and with extensive use of google etc I found this:
http://forums.devshed.com/showthrea...25817&forumid=1 Which I've rewritten to: PHP Code:
This works, but will only add the character to the textarea 'msg' & and not 'msg2'. The page will have ~25 input fields, so it needs the character inserted into the correct field. How can I change where the character is inserted? I'm assuming I'd need to use onFocus() or something here, but I tried setting a variable to store the current_focus (ie: var current_focus = 'msg2') passed this to the add_unicode_char(fieldname, str) function. However, this didn't work, otherwise I'd be relaxing at home right now. Can anyone with some knowledge of javascript help out here? Cheers, Simon |
![]() |
| Viewing: Dev Shed Forums > Web Design > Web Design Help > How to make an extended character inserter for a form? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|