Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Posts
    19

    Unanswered: PHP/MySQL and javascript rusure()

    Hi,

    I want to use the following javascript function combined with PHP:

    <HEAD>
    <script>

    function rusure(){
    question = confirm(" Deseas Borrar ?")
    if (question !="0"){
    top.location = "list2.php?CODIGO=<?php echo $row_Recordset1['CODIGO']; ?>"
    }
    }
    </script>
    </HEAD>

    If you can see, I added a variable to the link. The next part is this:

    <?php do { ?>
    <tr bgcolor="#FFFFFF">
    <td class="letramenu3"><?php echo $row_Recordset1['CODIGO']; ?></td>
    <td class="letramenu3"><?php echo $row_Recordset1['REFERENCIA1']; ?></td>
    <td class="letramenu3"><?php echo $row_Recordset1['DESCRIPCION']; ?></td>
    <td><div align="center"><a href=""onClick="rusure(); return false;"><img src="trash.jpg" width="16" height="16" border="0"></a></div></td>
    </tr>

    This script/loop bring to the browser a big list from MySQL, . One of the lopped columns is a link URL, the one that deals with the rusure() function.
    Everything is work but the loop is not working only for this column.

    It just bring the first row of the database,
    I dont know hot to deal with this, the order, etc.

    I Hope that the explanation is understandable.

    Thanks.

  2. #2
    Join Date
    Feb 2004
    Posts
    29
    Code:
    <td><div align="center"><a href=""onClick="rusure(); return false;"><img src="trash.jpg" width="16" height="16" border="0"></a></div></td>
    try this one
    Code:
    <td><div align="center"><a href="javascript:rusure()"><img src="trash.jpg" width="16" height="16" border="0"></a></div></td>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •