[Phpwm] text counter in iframe

Phil Beynon phil at infolinkelectronics.co.uk
Thu Nov 23 11:18:26 GMT 2006


Hi,
Don't know if this actually can be done.......

I've got an javascript and iframe based WYSIWYG data entry system on a page
http://koivi.com/WYSIWYG-Editor/, this uses an iframe for flipping between
text and html views and does pretty much all the normal stuff to text, bold,
highlight, fonts, fonts size etc.
Behind the scenes it uses a hidden textarea into which everything is moved
prior to either submitting or spellchecking the users input.

Separately I have a javascript text counter which works just fine within
ordinary input and textarea type fields
http://webonweboff.com/widgets/js/text_counter.aspx, displaying a countdown
against a preset number of characters, when it hits zero no more characters
are allowed to be added to the field, thus stopping any possible database
field trucation.

These bits works fine by themselves, no issues at all.


If I unhide the textarea and tell the textcounter to look at the textarea
created I can see that any text that I tell it to spell check appears in
there, sent across via a document.write but the textcounter routine doesnt
act on it immediately in the same way as text typed into the textarea, in
fact it doesnt seem to get invoked at all until something is typed into the
textarea, despite being triggered by an onchange.
I can see that the textcounter might not be happy as such with the iframe
area since this is effectively away from the current page, but I'd have
though that a document.write to the textarea should have triggered the
onchange in the seperate textcounter routine, or am I missing something
obvious there!

Phil




More information about the Phpwm mailing list