Welcome Guest, Not a member yet? Register   Sign In
How to apply onClick event in my foreach?
#1

[eluser]Wondering Coder[/eluser]
Code:
if($job_list->num_rows() > 0){
                foreach($job_list->result() as $item){
                    echo "<tr style='border-bottom: gray;'><td width ='1px'></td><td><p><a href=''>".$item->job_title."</a></p></td></tr>";              
                }
            }else{
                echo "Sorry, No Available Jobs";
            }  
            ?&gt;

I've searched on the net on how to use an onclick event <a href="#"> but don't know how to apply it in my code(coz of foreach).
What i want to do is when I clicked my link it will popup a new window where it will display all necessary information of the job title.

For more information my primary key or id is job_id.
#2

[eluser]Frank Wong[/eluser]
There are many ways to do that. It seems like what you are looking for is a js implementation of onClick. Maybe give us an idea what what you have tried and that could lead us in your intended direction.

If you want to test out onClick, just add
Code:
onClick="alert('something');"
into your anchor link.
#3

[eluser]InsiteFX[/eluser]
Why not just use the URL Helper anchor?

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB