Új hozzászólás Aktív témák

  • Abrion

    senior tag

    válasz Sk8erPeter #2331 üzenetére

    vagy úgy az én hibám, gondoltam nem kell azt is bekopiznom, mert ott nincs fontos dolog, csak pár echo, de ha ennyire ragaszkodsz hozzá, bekopizom a benne lévö scriptet is.

    {
    while($row = mysql_fetch_array($sql)){
    $id=$row['id'];
    echo "<tr>";
    echo '<td id="'.$id.'" width="317px">' . $row['cim'] . '</td>';
    echo '<td width="142px">' . $row['link1'] . '</td>';
    echo '<td width="218px">' . $row['link2'] . '</td>';
    echo '


    <script type="text/javascript">
    $(document).ready(function() {
    $(\'#'.$id.'\').click(function(){
    var current_value = $(this).html();
    $(\'#name\').attr(\'value\', current_value);
    current_value = $(this).parent("tr").children("td").eq(1).html();
    $(\'#link1\').attr(\'value\', current_value);
    current_value = $(this).parent("tr").children("td").eq(2).html();
    $(\'#link2\').attr(\'value\', current_value);
    });
    });

    </script></tr>';
    }

    Index.php ban még ez maradt le

    <body>

    <table><tr><td><input type="text" size="49" name="name" id="name"></td><td><input type="text" size="20" id="link1" /></td><td><input type="text" size="30" id="link2"></td></tr>
    </table>

Új hozzászólás Aktív témák

Hirdetés