[SOLVED] How to set the field focus for login

13 years 8 months ago #138723 by darinh
Hello,

I was wondering if there is a way to set the initial cursor/field focus to the "Username" field for the cb_login module. I would like to have the cursor positioned in the Username field when the initial home page of my website loads.

Thanks

Post edited by: krileon, at: 2010/07/29 15:38

Please Log in to join the conversation.

13 years 8 months ago #138791 by krileon
Replied by krileon on topic Re:How to set the field focus for login
Not without a new plugin as you'd need to add JS to force focus on the username field. Using CB triggers such JS can be added to the registration form. Please see tutorials within signature for trigger usage.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 8 months ago #138835 by darinh
Replied by darinh on topic Re:How to set the field focus for login
Thank you for the information, I will take a look at the tutorials to see about creating a plugin to set the focus to the "Username" for the cb_login module.

Please Log in to join the conversation.

13 years 8 months ago #138859 by krileon
Replied by krileon on topic Re:How to set the field focus for login
Alternatively you could add JS to your Joomla template index.php to give focus to the username field (probably simplest and most practical approach). Example as follows.

[code:1]
<script language="JavaScript">
document.getElementById( 'mod_login_username' ).focus();
</script>
[/code:1]


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 8 months ago #138897 by darinh
Replied by darinh on topic Re:How to set the field focus for login
Thanks for the code, it worked perfectly.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.161 seconds

Facebook Twitter LinkedIn