• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
anchor onclick and target=_blank

#1
[eluser]PHP Programmer[/eluser]
How can I set onclick function in CI's anchor function.

I used the following:

echo anchor("jobs/SaveJob/$search->jobs_emp_id/$search->employer_id", 'Save this job', "onclick=\"return [removed]save_job('$search->jobs_emp_id','$search->employer_id','$search->job_title')\"");

I didn't get any JS function on clicking the link.
Also, I want the page to be opened in new window. How can I use "target=_blank" along with the above statement.

Also, I need a tooltip (to be called from database) on clicking the link.

Please suggest...

#2
[eluser]Unknown[/eluser]
Use the manual, Luke.

anchor('url','text', array('onclick' => "alert('test')"));


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.