Jump to content

Get Value To Edit Correct Record


Recommended Posts

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

Edited by dzhax
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...