I made a Modal Dialog that opens when you click the link
<a href="#modalDialog">Edit Name</a>
So after clicking that link the modal appears but the problem is that I don't know how to pass a usr variable for me to extract while at the same time opening the id called #modalDialog, something like this:
<a href="#modalDialog?itemid=1">Edit Name</a>
This other method redirects the page and opens the id, but the point is that I'm trying to avoid refreshing or redirecting to other pages just to edit a simple name, it goes like this:
<a href="?itemid=1#modalDialog">Edit Name</a>
I would to say thanks in advance!
I think you will want to use a data-* attribute within the anchor. Then access it using Javascript or JQuery.
<a href="#modalDialog" data-itemid="1" class="edit-name-link" >Edit Name</a>
Then in JQuery
$(".edit-name-link").click(
function()
{
var itemid = $(this).attr("data-itemid"); // this will get the clicked itemid
//now open your modal however you opened it before, and do something with itemid
});