Jump to content

Javascript Navigation


dzhax

Recommended Posts

I am using the following code to redirect to the same page with the following variables for further processing, but it will not redirect.

function remove_card($id){		window.location = "?f=remove_record`" . $id;	}

It seems that it is trying to go to a file just named that when I need it to go to the current file while adding to the end of it.for instance say the current page is info.phpit would need to redirect to info.php?f=remove_record`IDNUMBERThanks for any help.

Link to comment
Share on other sites

window.location only accepts full URLs. You have to somehow determine the path of the current URL.

Link to comment
Share on other sites

not sure what you mean.Also 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'].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.Got the popup from http://www.php-development.ru/javascripts/popup-window.php

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...