0

I have display all categories from cat table.When click on edit button ,i want to pass category id to popup editor in same page.how to pass cat_id to popup window?this is my code

-----Display all categories from cat table----

 <?php
                 $query= "SELECT  * FROM cat WHERE res_id='".$resid."'" ;
                $result= mysql_query($query);

                while($row = mysql_fetch_assoc($result)){

                $id=$row['cat_id'];
                 ?>


                <div class="menusubs">
                    <a href="#" class="js__p_1_start"><div class="menusubsname"><?php echo $row['cat'];?></div> 
                    <div class="menusubsimg"><img src="../img/dashbord/edit.png"/></div></a>
                </div>
             <?php                                      
                }                               

            ?>

---popup window----

<div class="popup js__1_popup js__slide_top">
    <a href="#" class="p_close js__p_close x"><img src="../img/dashbord/popup_close.png"/></a>
    <div class="p_content">
        <div class="menupop">

            <div class="menupoprow"><input type="text" class="poptbox" name="" placeholder="Category name" value="" /></div>
            <div class="menupoprow"><textarea class="poptabox" placeholder="Description name"></textarea></div>
            <div class="menupoprow"><textarea class="poptabox" placeholder="Category tags"></textarea></div>


            <div class="menupoprow">
                <div class="popb1"><input type="image" width="30" value="submit" src="../img/dashbord/deletebtn.png" alt="submit Button" onMouseOut="this.src='../img/dashbord/deletebtn.png'" onMouseOver="this.src='../img/dashbord/deletebtn.png'"></div>


            </div>

        </div>
    </div>
  </div>

when click on Drinks,i want to pass relevant cat_id of Drinks to this popup.

popup

Tje123
  • 729
  • 17
  • 44
  • Perhaps [this answer](http://stackoverflow.com/questions/9994120/javascript-pass-selected-value-from-popup-window-to-parent-window-input-box/10407064#10407064) will help you further. – Ja͢ck Mar 10 '15 at 08:01

1 Answers1

0

For Complete Solution , Send me Full Code.

Possible Solution is you have to run Foreach loop which will depend on DataBase Select Query.

On click of Drinks you should pass cat_id as QueryString HTTP_GET Request.

So , When browser open pop-ups then it will read QueryString From URL and display it to relevant TextBox

If you have still any confusion , let me know

MONTS_MIND_Hacker
  • 1,727
  • 2
  • 9
  • 9