Time:
Scotland: Sat, 6:40 am
Rhode Island: Sat, 1:40 am
Florida: Sat, 1:40 am
New Mexico: Fri, 11:40 pm
California: Fri, 10:40 pm

Click here to visit Livelife365.com

Click here to visit nmdarts.com



Buy this Ad Space.

180px wide.

Please get in touch with KH@ if you are interested and make an offer.

Selanac Embroidery and Screen Printing

Embroidery
Screen Printing
Signs and Banners
Promotional Advertising

WEBSITE

Contact Paul Canales
TEl: USA 732-901-8417
CELL: USA 732-773-1339


Please click here for more information


For continued disscussion on this topic : Assistance needed!! - Kiosk system, virtual keyboard


Fishbait
01-30-2001, 05:17 PM
Sample picture of application, for reference only. (http://freeweb.pdq.net/dstalker/graphics/main_sample.gif)

Hey, ok, I'll be as quick as possible to explain what I'm "trying" to do, and include all code I currently have.

I have 2 frame windows ('main_window', 'keyboard_window') for a Kiosk application. The 'keyboard_window' sends the letter that is pressed by the user to the 'frames_main' page (frameset) which calls the function virtualTyper. This function then sends the corresponding letter to the first_name text box in the 'main_window'.

By default the application loads up and the text box that has the focus is first_name. When a user presses the Q button in 'keyboard_window' it sends the letter Q to the first_name box in 'main_window'. Got it? Good!

What I've been trying to do is use a hidden object (input type=hidden) whose value should change depending upon which text box currently has the focus in the form. Lets say the first page has 10 boxes in the form. First name, Last name, Address, etc. Then I would like my function virtualTyper to look at the value of the hidden object and type the letters that are pressed in the appropriate text box. Currently the virtualTyper function is hard coded to the first_name box, and I have been having trouble getting it to type in any other boxes. Any assistance would be greatly appreciated!!!

If my method of thinking is not moving in the right direction, please advise. Thank you!!

'frames_main' (frameset page)
-----------------------------
<script language="JavaScript">
function virtualTyper(abcdef)
{
top.frames['main_window'].document.client_one.first_name.value+=abcdef
}
</SCRIPT>


'main_window' (where form is located)
-------------------------------------
<input type="hidden" name="has_focus" value="">

<input type="text" name="first_name" size="30" onFocus="client_one.has_focus.value='first_name'">
<cfinput type="text" name="occupation" size="20" onFocus="client_one.has_focus.value='occupation'">


'keyboard_window' (virtual kiosk keyboard)
------------------------------------------
<input type="image" onClick="parent.virtualTyper('Q');" src="graphics/keyboard_button_Q.gif">

voicebox
01-30-2001, 05:24 PM
The events onfocus and onblur are signalled on text fields whenever they gain/lose focus, set a variable whenever these events occur e.g.
<input onfocus="this.form.has_focus.value = 'thisone'" onfocus="this.form.has_focus.value = ''">
then refer to that like this:
var f = top.frames['main_window'].document.client_one;
f[f.has_focus.value].value+=abcdef;

gzazJim
01-30-2001, 05:25 PM
Hey Fishbait, and welcome to the forum.

I have a question before I can really be of any assistance. How does the user move from text-box to text-box? If the "virtual typer" is hard-coded onto the first text box, you'll have to loosen it up a bit. Basically the way I'm thinking is with an onFocus event, you'd change the "pointer" in the Virtual-Typer script to the newly in-focus text-box.

You'll have to add a "next field" key (if there's no keyboard or mouse) in order for the user to move to the next field.

I am assuming this is a touchscreen application?

Let us know, and we'll do what we can to assist you!

Regards,

Jim

Fishbait
01-30-2001, 05:45 PM
Thanks for the replies.. I'll try to give more information as requested.

Yes, this is a touchscreen application. It is written in ColdFusion, HTML, and SQL, with JavaScript for the virtualKeyboard function. I am usually a pure CF developer and have only skimmed the surfaces of JavaScript.

The user moves from text box to text box by clicking inside each text field to begin typing. This is where I wanted to use JavaScript to determine which field has the focus and allow the virtualKeyboard function to type in the appropriate fields.

Jim you suggested "an onFocus event, you'd change the pointer in the Virtual-Typer script to the newly in-focus text-box" - How would I go about doing this? I have my JavaScript Bible here next to me, and am willing to look up whatever so I can get this baby working!

Thanks!!

voicebox
01-30-2001, 06:41 PM
Have a look at the script I posted...

Fishbait
01-30-2001, 06:58 PM
hey voicebox, i used your script and it worked perfectly! thanks very much for the assistance... i was at a loss for a moment (like i said, haven't used javascript that much) but i figured it out.

maybe you can assist me with one more detail... if i added another hidden variable, this time called form_focus, and used it to set the value of the current form name (ie: client_one) i could re-use this script for multiple form pages. how would i go about adding that into the code so the area where it says client_one can now be pulled from the hidden variable form_focus?

I was thinking:

var f = top.frames['main_window'].document.form_focus.value;
f[f.has_focus.value].value+=abcdef;

Is this correct??

Much obliged!!!!!!

voicebox
01-30-2001, 09:13 PM
You can only put hidden elements into forms. If you put it into client_one the code would look like this:
var d = top.frames['main_window'].document;
var f = d[d.client_one.form_focus.value];
Then the rest of the code would be the same.