Welcome Guest, Not a member yet? Register   Sign In
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')"));




Theme © iAndrew 2016 - Forum software by © MyBB