CodeIgniter Forums

Full Version: How can one use OnClick with anchor in CodeIgniter ???
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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

El Forum

[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?

El Forum

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

thanks