Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dmcglone27's avatar

Link

I'm going throug the bootstrap docs and I want to try using a modal for registration and/or login, maybe both. Is it possible to translate a java link into a laravel blade link? For example, can this link be converted to a laravel blade link?

<button onclick="document.getElementById('id01').style.display='block'"
    class="w3-button w3-green w3-right-align">Register</button>

0 likes
14 replies
dmcglone27's avatar

@shaungbhone I'm wondering if It's possible to convert the java link above into a laravel link. such as

{!! <a href= "events/$events->id">$event->name</a> !!}

jlrdw's avatar

@dmcglone27 Normally you can have a link like:

<a href="javascript:void(0);" id="testme">testme</a>

And a listener that opens the model, once the link is clicked, they work together.

2 likes
shaungbhone's avatar

I don't understand

For example, can this link be converted to a laravel blade link?

your code is just a modal when you click the Register button, the modal is come out.

2 likes
dmcglone27's avatar

@shaungbhone I'm trying to get a better understanding of links in laravel. Basically all I am wondering is if the Java link can be written in laravel.

1 like
martinbean's avatar

@dmcglone27 What do you mean, “Java link”? I don’t understand what you’re wanting. If you just want a link to open a modal, then just do that:

<a href="{{ route('register') }}" data-bs-toggle="modal" data-bs-target="#register-modal">Register</a>
2 likes
Snapey's avatar

please learn the difference between java and javascript - a quick google search should do it.

this

<button onclick="document.getElementById('id01').style.display='block'"

says, when the button is clicked, find an element on the page with id="id01" and change its display style to block

Assuming the item is currently hidden then it will be unhidden

Please note that this has ZERO relation to Laravel and ZERO relation to Java

2 likes
dmcglone27's avatar

@Snapey Thanks. It turned out I was way overthinking this. Once I seen how it worked using a simple link or button, I smacked myself.

It was as simple as

<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
dmcglone27's avatar

@Snapey Oh and I forgot the link that opens the modal..

<button type="button" class="btn btn-success" data-bs-toggle="modal" data-bs-target="#register">
    Register
</button>

Snapey's avatar

@dmcglone27 ok, as long as you realise that this is Bootstrap javascript plugin that makes this work. Not some feature of native javascript or of Laravel

2 likes

Please or to participate in this conversation.