Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By octavecat on
Hi all,
I'd like to change the in the login block to a <a href="javascript:void(0);" onclick="submit" class="btn-submit">Log in</a>
. Drupal doesn't seem to let me theme the form_render function. Can anyone tell me what I should do?
Thanks
Comments
Not sure how to 'theme' that
but I would suggest an alternate method for putting the anchor and Javascript there.
Your approach would break for user agents without Javascript for whatever reason.
I personally would try to change the DOM when the page loads so that the original form button gets changed to your anchor above. That way browsers that do Javascript will behave how you want, but non Javascript users will still have the standard form button.
I haven't tried anything like that within Drupal though.
--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal