I know this is old, but I had this problem and maybe it helps someone.
If you use jQuery, this works:
$("input[name='c_name']").focus();
Javascript will be something like this (general example):
document.getElementById('element').focus();
But you must call this function after your form is loaded via ajax!
source share