Is there an alternative to the script I’m using, because I’m running into a conflict with another script for validation?
I’m trying to focus into the first input upon page load.
$(document).ready(function() {
$('form:first *:input[type!=hidden]:first').focus();
});
You could use the
autofocusattribute from HTML5 and only use JavaScript as a fallback which will mean that modern browsers wont run into that problem.With preventing the conflict I’d assume your validation library is using the focus to initially do validation so the only way I could think to solve it is to programatically add your JavaScript validation library after you’ve executed the focus code.