/*
* The function focusFirst puts the Focus on the first non-hidden element in the Survey.
*
* Normally this is the first input field (the first answer).
*/
function focusFirst(Event)
{
var i=0;
// count up as long as the elements are hidden
while(document.forms[0].elements.type == "hidden" &&
document.forms[0].elements.style.visibility == 'visible')
{
i++;
}
// put focus on the element we just counted.
if (document.forms[0].elements.type == "hidden" &&
document.forms[0].elements.style.visibility == 'visible')
{
document.forms[0].elements.focus();
}
return;
}
/*
* The focusFirst function is added to the eventlistener, when the page is loaded.
*
* This can be used to start other functions on pageload as well. Just put it inside the 'ready' function block
*/

/*
* The function focusFirst puts the Focus on the first non-hidden element in the Survey.
*
* Normally this is the first input field (the first answer).
*/
function focusFirst(Event)
{
var i=0;
// count up as long as the elements are hidden
while(document.forms[0].elements.type == "hidden" &&
document.forms[0].elements.style.visibility == 'visible')
{
i++;
}
// put focus on the element we just counted.
if (document.forms[0].elements.type == "hidden" &&
document.forms[0].elements.style.visibility == 'visible')
{
document.forms[0].elements.focus();
}
return;
}
/*
* The focusFirst function is added to the eventlistener, when the page is loaded.
*
* This can be used to start other functions on pageload as well. Just put it inside the 'ready' function block
*/