2

So when I put these buttons inside an article they worked fine.

As soon as I put them in a module (so I could show them dependent on if the user is logged in or not) they stopped working.

The first button takes you to the registration page The second button takes you to log in page *both via menu items

But now when in a module the first button takes you to log in page and the second stays blank on index.php

My code is as follows below:

<div style="text-align: center;">
<form action="http://get2gethersports.com/edit-user-profile?view=registration" method="get">
    <button type="submit"> Join Now </button>
</form>
<form action="http://get2gethersports.com/index.php?option=com_users&view=login" method="get">
    <button type="submit"> Login </button>
</form>
</div>

Any help would be greatly appreciated.

5
  • Why are you using a form for this? Wouldn't it be easier to use a regular link (and style it as a button using CSS)? For example: <a href="http://get2gethersports.com/edit-user-profile?view=registration" class="btn btn-primary">Login</a>
    – johanpw
    Nov 7, 2014 at 19:22
  • That worked! And I guess I took making a button more literally then I should have...
    – Web Dev
    Nov 7, 2014 at 19:27
  • Great. That still doesn't answer why your code works in an article but not within a module. I don't see any immediate reason for that. Maybe someone else has an explanation?
    – johanpw
    Nov 7, 2014 at 19:51
  • Toggling prepared content might help....
    – Faye
    Nov 7, 2014 at 19:55
  • I did make to prepare content was on. very weird.
    – Web Dev
    Nov 8, 2014 at 6:43

1 Answer 1

0

You can use a regular link instead of a form, and style them using CSS, something like this:

<div style="text-align: center;">
   <p>
      <a href="http://example.com/index.php?option=com_users&view=registration" class="btn btn-primary"> Join Now </a>
   </p>
   <p>
      <a href="http://example.com/index.php?option=com_users&view=login" class="btn btn-success"> Login </a>
   </p>
</div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.