echo '<a href="javascript:void(0)" onClick="javascript:chatWith('.$result[3].')">'.$result[3].'</a>';


only the $result[3] between the <a> and </a> gets displayed....i want to display also the $result[3] within the javascript function call....is thr any error in it??

What type of parameter is chatWith() expecting? What type of value is $result[3]? If it's a string (and I'm guessing it is), try adding escaped single quotes \' around the $result[3] that is sent to the JavaScript function:

echo '<a href="javascript:void(0)" onClick="javascript:chatWith([B]\'[/B]'.$result[3].'[B]\'[/B])">'.$result[3].'</a>';

Dave

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.