Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

single answer text box tbxAnswer_xxx auto focus
(1 viewing) (1) Guest
component
Go to bottomPage: 1
TOPIC: single answer text box tbxAnswer_xxx auto focus
#65573
single answer text box tbxAnswer_xxx auto focus 5 Years, 1 Month ago Karma: 0
Hi AriSoft Team

I have questions with single answers where students are doing a speed test.
Is there a way I can have the answer textbox tbxAnswer_xxx to have focus already on load of question. On 100 speed questions a lot of time is wasted to first have to click in the answer box to complete the answer.

I really hope you can assist. I am a programmer, but are not so clued up with JavaScript and this component. I will be able to add or change code, I just need proper direction. I really want this component to work as my customer thought it would be in comparison to other quiz examples he showed me.

I tried adding autofocus to the input tag, and also added document.getElementById(ctrlId).focus(); to the draw function at AQ.questions.FreeTextQuestion in file com_ariquiz/assets/js/questions.js but it is not working.

Thanks in advance
Chris
getafix
What goes around comes around.
User Offline Click here to see the profile of this user
Gender: Male GetafixZA Getafix IT Solutions
The administrator has disabled public write access.
 
#65574
Re:single answer text box tbxAnswer_xxx auto focus 5 Years, 1 Month ago Karma: 0
I am not able to get focus with cursor in the answer textbox yet, but do have another solution by using a JavaScript keypad and/or capturing the keyboard input and add the input to the answer textbox. I will upload my code example in that TOPIC: "Math speed quiz with numerical virrtual keyboad" (Excuse spelling virtual keyboard )
getafix
What goes around comes around.
User Offline Click here to see the profile of this user
Gender: Male GetafixZA Getafix IT Solutions
The administrator has disabled public write access.
 
#65583
Re:single answer text box tbxAnswer_xxx auto focus 5 Years, 1 Month ago Karma: 760
Hello,

Add the following code to the end of "draw()" method for AQ.questions.FreeTextQuestion question type to enable auto focus:

Code:


Event.onAvailable(ctrlId, function () {
  this.previousSibling.focus();
});



Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1