Page 1 of 1

javascript : Onload event

PostPosted: Tue Nov 03, 2009 7:29 am
by Jean
Hi Steve,

I need to have a focus on a field in the new form. I know how to do it in a form but on Xataface I don't know have the onLoad event. I tried to create in javascript.js a bodyOnload() function but no result.

Code: Select all
function bodyOnload(){
document.getElementById('nom_famille').focus();
}


Can you put me on the right track ?

Thank you
Jean

PostPosted: Tue Nov 03, 2009 5:48 pm
by shannah
I seem to recall adding this functionality to the fields.ini file a while back. Try using the widget:focus directive in the fields.ini file:

e.g.
Code: Select all
[myfield]
    widget:focus=1

PostPosted: Wed Nov 04, 2009 12:38 am
by Jean
Thank you Steve, it works, you're amazing!!!
:o