Problem calling a javascript function from an Action/Value field?
November 3, 2011 12:00 AM
Hi
I am hoping someone can help. I have an on-screen keyboard to allow a user to enter their employee number as part of a sign on process. The end product is captured in a variable called 'Driver' and displayed via a text box. This part is working fine. The problem I am having is allowing the user to press a backspace, variable 'bksp', key to delete the employee number 1 character at a time if they make a mistake. I have found the solution using javascript, substring or slice, and this works fine as a standalone piece of code but I cant seem to get it to work inside lectora. It only needs to work on the one page.
I have the code in an external HTML object, are the settings are correct?
object name: backspace_key
object type: header scripting
code:var y = VarDriver.getValue();
var x = substring(0, y.length - 1);
Varbksp.set(x);
Have I missed something in the code?
Action:
On: mouse click
Action: Modify Variable
Target: BkSp
Value: javascript:backspace_key
Modification type: Set Variable contents
What do you put into the Value field within the action to call the javascript?
I am trying to make the elearning as real as possible as the crews will be using touchscreen technology within the vehicles so it is better for me to simulate the entry from an on-screen keyboard rather than have the user use a standard keyboard which would be input into an Entry field, which is my backup if all else fails :(
Any help is appreciated.
Cheers
Colin
Discussion (1)
Hi colin and everyone,
Well, I was searching for on screen keyboard function in lectora and I found this forum. I need to integrate an on screen keyboard in lectora in entry field, so that students can type answer online. How can I achieve it, Please help me.
Discussions have been disabled for this post