Ian Collins wrote:
>
What exactly is the sequence of events you use? The user loads a page
(any page?) and then does something to add a virtual keyboard, how?
Currently I offer site owners or forum Administrators the following
(seeing on
http://RusWin.net/readme_e.htm and say
on working example at
http://RusWin.net/vkbFly2e.htm ):
1) Add one line to <headwith vkb_load.js
(this .js loads then other .js and several .css 'silently' to the
<head>)
2) Below last input field of the form (it could be numerous <textarea
and/or <input type=text fields) insert the line
<script type="text/javascript">vkb Init(document.i nputForm);</script>
that function successfully adds onfocus, onkeypressed, and other I need
to
the text input field (because it's executed while the page is still
under "evaluation " by the browser, so browser does notice those
additional evenhandlers on text fields)
If I copy this into the address bar (found somewhere on the Web)
javascript
:x=do cument.body.inn erHTML.replace(/</g,'<').repla ce(/\n/g,'<br>');
document.body.i nnerHTML = x;
then I see my changes! That is, I see onfocus=, onclick=, etc. in text
fields' HTML
3) Add a line that user of their site/forum woudl use to call Virtual
Keyboard, say
<BUTTON TYPE=button onclick="blur() ; showKbd(); return false;" .........
=============== =============== =============
The above works just FINE - as working examples show.
But I created this thread to try to do the same DIFFERENT way -
without item (2) - to avoid changing objects 'just in case' -
who knows may be a user never clicks on Keyboard button -
instead of (2) I wanted to execute that vkb_Init() which adds
evenhandlers only when a user clicks on Keyboard button.
I tried and it failed and it's why I opened this thread -
looks like when I do the additions after a user clicks the button,
it's too late - the page has already been evaluated by the browser
and browser does NOT see the additions (onfocus, onclick,...) I made
in vkb_Init() when it's called after a user clicks the button -
nothing works and also page's source does not show those additions
if I paste the "look at source" line into the address bar.
So I am asking, "How to force a browser to re-evaluate HTML code
of the forms' elements".
But if it's not possible:
may be it does not work because I do those additions via
outerHTML of the objects. Is there another way to add eventhandlers?
outerHTML was the only (cross-browser) thing I found when I used
Google for something like, "Add textarea properties".
Because again, this thing (which is what I want) is IE-only:
<SCRIPT LANGUAGE=javasc ript FOR=textEl EVENT=onfocus>
myFunction(even t);
</SCRIPT>
--
Regards,
Paul