Jump to content

Call javascript function from php echo href


anton_1

Recommended Posts

Thanks in advance for any help guys

 

<script type="text/javascript">

 

 

function showDialog() { $('#box').fadeIn(250); $('#box').fadeTo(0.5); }

function hideDialog() { $('#box').fadeOut(250); }

 

</script>

 

<?php

   

$strLink = "<a href='viewTicket.php?id={$row['id']}'>$strName</a>";

 

 

?>

here is the correct method.

 

<script type="text/javascript">


function showDialog() { $('#box').fadeIn(250); $('#box').fadeTo(0.5); }
function hideDialog() { $('#box').fadeOut(250); }

</script>

<?php
    
$strLink = "<a href='viewTicket.php?id=" .$row['id']. "'>" .$strName. "</a>";


?>

it should work :)

$strLink = "<a href='viewTicket.php?id={$row['id']}' class='simpledialog'>$strName</a>";

 

 

 

$(function() {

  $('.simpledialog').click(function() {

    $('#box').fadeIn(250).fadeTo(0.5);

  }

});

 

 

echoing the class?

anton_1, are you trying to use the

$strLink = "<a href='viewTicket.php?id={$row['id']}' class='simpledialog'>$strName</a>";

to fade in an id called box? you are already using the href to link it to another page thus the simpledialog function cannot be used.

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.