Skip to content Skip to sidebar Skip to footer

Passing Variable To Popup Box

i have a bit complicated problem about passing variables in php. I have listed and nested items in html
    tag and near every item i have button which should edit name of

Solution 1:

I think the best option will be to use jQuery. Here's a working example, setting dynamically the path of the forms

$('.toggler').click(function(){
  var path = $(this).attr('path');
  $('#popupEdit').css('display','block');
  $('.pathinput').val(path);
  $('.path').text(path);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<button class="toggler" path="example text">Click Me</button>
<button class="toggler" path="example text 2">Click Me 2</button>
<button class="toggler" path="example text 3">Click Me 2</button>



             
<div id="popupEdit" class="popupEdit" style="display: none">
    <p class="path"></p>
    <div class="popupEdit-content">
        <form action="rename.php" method="post">
            <input type="text" name="path" class="pathinput" value="PATHHERE" >
            <input type="text" name="new-name" placeholder="nowa nazwa">
            <input type="submit" value="Submit" class="popupEdit-submit">
        </form>
    </div>
</div>

Post a Comment for "Passing Variable To Popup Box"