dzhax Posted September 27, 2009 Share Posted September 27, 2009 if I am using php to query a mysql database, I want to make the edit option a js popup box. I have the box but I am having trouble making it edit the correct record. Any suggestions?I have this so far <img src="Check Mark.gif" onclick="popup_show('popup', 'popup_drag', 'popup_exit', 'screen-center', 0, 0);" /> The record would come from $array['id'].with failed cookies idea <img src="Check Mark.gif" onclick="popup_show('popup', 'popup_drag', 'popup_exit', 'screen-center', 0, 0); <?php setcookie('remove', $array['id']); ?>" /> this is the popupbox code itself <link rel="stylesheet" type="text/css" href="sample.css" /><script type="text/javascript" src="popup-window.js"></script><div class="sample_popup" id="popup" style="display: none;"> <div class="menu_form_header" id="popup_drag"> <img class="menu_form_exit" id="popup_exit" src="form_exit.png" alt="" /> Edit Record </div> <div class="menu_form_body"> <?php $msg = 'edit_record`' . $_COOKIE['record'];?> <form action="" method="get"> <input id="record_delete_id" name="f" type="hidden" value="" /> <table> <tr> <th> name: </th> <td> <input class="field" type="text" onfocus="select();" name="new_name" /> </td> </tr> <tr> <th> series_number: </th> <td> <input class="field" type="text" onfocus="select();" name="new_series_number" /> </td> </tr> <tr> <th> series_name: </th> <td> <input class="field" type="text" onfocus="select();" name="new_series_name" /> </td> </tr> <tr> <th> </th> <td> <input class="btn" type="submit" value="Submit" /> </td> </tr> </table> </form></div></div> Line 11: is the line that would need the id from the row. That will return the correct string for proccessing the change. I tried to use cookies, but it would only change the last one no matter what one you choose. My cookies attempt is a couple line above in the php code setting $msg variable.Got the popup from http://www.php-development.ru/javascripts/popup-window.phpThanks Link to comment Share on other sites More sharing options...
justsomeguy Posted September 28, 2009 Share Posted September 28, 2009 Why don't you just use PHP to write out the ID and whatever other details in the code for the popup area? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.