Jump to content
php.lv forumi

Nefunkcionē JS dzēšanas confirm dialogs


senters

Recommended Posts

Šeit JS f-ja:

<script type="text/javascript">
function apstiprinajums_dzesanai(xxx_id, xxx_nosaukums) 
{

[indent]var answer = confirm("Vai tu patiešām vēlies dzēst " + xxx_nosaukums)
if (answer)
{
 alert("Dzēš...")
 window.location = "main.php?cat=2&dzest_id=" + xxx_id;
}
else
{
 alert("Atcelts...")
}[/indent]

}
</script>

 

Te PHP fragments, kur šī f-ja tiek pasaukta:

 

<?php
				$sql="SELECT * FROM tabula WHERE xxx_lietotajs_id = '$lietotajs_id'";
				$qry = mysql_query($sql) or die(mysql_error());

				while ($rinda = mysql_fetch_array($qry)) 
				{
					$xxx_id = $rinda["xxx_id"];
					$xxx_nosaukums = $rinda["xxx_nosaukums"];
					$xxx_cena = $rinda["xxx_cena"];
					$xxx_datums = $rinda["xxx_datums"];
					$xxx_kategorija = $rinda["xxx_kategorija"];

				echo "
					<tr class='hover_1'>
						<td><img src='Images/item.png' /></td>
						<td>".$xxx_datums."</td>
						<td>".$xxx_nosaukums."</a></td>
						<td>".$xxx_cena."</td>
						<td>".$xxx_kategorija."</td>
						<td>
							<a onclick='apstiprinajums_dzesanai(".$xxx_id.", ".$xxx_nosaukums."); return false' href='#'><img src='Images/icon_del.png' /></a>
						</td>
					</tr>";
				}
?>

 

Uzspiežot uz dzēst (icon_del) ikonas nekas nenotiek, skatījos ar FF bug consoli, bet gudrāks nepaliku.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...