Force focus to any field

Saumier

Member
This is similar to another thread I started last week. My question is how to apply setting focus to any field. I have a small test site with basic Joomla setup and Fabrik. I have the following code for "Focus Test", testing using form_2 and element = field1:

Code:
var fld1 = form_2.formElements.get('tw_focus___field1');
focustest(fld1);
And in 2.js

Code:
function focustest(input) {
var fldin = input.getValue();
// alert("Input function = " + fldin);
if (fldin == "kathy") return true;
alert("Input is not kathy " + fldin);
input.clear();
document.input.focus();
return false;
}
Everything works fine except setting focus when the test fails. I've tried standard js statements, but nothing has worked so far. Seems simple, but your help is surely appreciated.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top