javascript : Onload event
Archived from the Xataface Users forum.
Jean — Tue Nov 03, 2009 7:29 am
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
shannah — Tue Nov 03, 2009 5:48 pm
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
Jean — Wed Nov 04, 2009 12:38 am
Thank you Steve, it works, you’re amazing!!!