CodeIgniter Forums
How can one use OnClick with anchor in CodeIgniter ??? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: How can one use OnClick with anchor in CodeIgniter ??? (/thread-52921.html)



How can one use OnClick with anchor in CodeIgniter ??? - El Forum - 07-02-2012

[eluser]Maverick7[/eluser]
I am trying to replace the onClick echo code with an anchor that will run OnClick...

Code:
<?php
// How can one use OnClick with anchor in CodeIgniter ???

echo '<tr class="'.$tr_class.'" height="25" align="left" valign="top" title="Click to Update highlighted Record"';

echo '

echo '>';

?&gt;

This code tags aren't showing code right so I attached code view.

attachments aren't working either here Sad

Thanks Smile


How can one use OnClick with anchor in CodeIgniter ??? - El Forum - 07-02-2012

[eluser]PhilTem[/eluser]
Code:
echo anchor('#', 'Click on me!', array('onClick' => 'yourJavaScriptFunctionToPerform();'));

Or do you want to have the 'onClick' attribute to your tr/td?


How can one use OnClick with anchor in CodeIgniter ??? - El Forum - 07-02-2012

[eluser]Maverick7[/eluser]
Yes, it's part of a for loop that gives rows and I am trying to pull up single records : )

thanks