Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change_form first element focus no longer works. #295

Closed
danielsamuels opened this issue Oct 7, 2014 · 1 comment
Closed

change_form first element focus no longer works. #295

danielsamuels opened this issue Oct 7, 2014 · 1 comment

Comments

@danielsamuels
Copy link

I'm not sure when it broke, but the line

<script type="text/javascript">document.getElementById("{{ adminform.first_field.id_for_label }}").focus();</script>

no longer works and throws a JS error. I fixed it in my project by replacing it with this:

<script type="text/javascript">$('form#{{ opts.model_name }}_form :input:not(.btn):visible:enabled:first').focus() </script>

@darklow
Copy link
Owner

darklow commented Oct 7, 2014

Yes, there is pull request ready for this, i will fix it soon: #290

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants