Connecting Tech Pros Worldwide Forums | Help | Site Map

problem in javascript using php

Banned
 
Join Date: Mar 2008
Posts: 10
#1: Mar 25 '08
hi,

the below line will not work properly.please tell that what i did the mistake in that code.
[php]echo "<td><A HREF='javascript:pick(" . $row['first_name']
. ")'>" . $row['first_name'] . "</A></td>";[/php]

ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#2: Mar 25 '08

re: problem in javascript using php


Please enclose your posted code in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use [code] tags in future.

MODERATOR
hsriat's Avatar
Expert
 
Join Date: Jan 2008
Location: Bath, UK
Posts: 1,609
#3: Mar 25 '08

re: problem in javascript using php


[php]echo "<td><a href=\"javascript:pick('". $row['first_name']."')\">".$row['first_name']."</a></td>";[/php]
ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#4: Mar 25 '08

re: problem in javascript using php


Quote:

Originally Posted by sravani1

hi,

the below line will not work properly.please tell that what i did the mistake in that code.
[php]echo "<td><A HREF='javascript:pick(" . $row['first_name']
. ")'>" . $row['first_name'] . "</A></td>";[/php]

What do you mean by ...'not work properly...'. Does it return an error? Does it not execute? Only thing I can see is that the first_name is not enclosed within quotation marks.

Ronald
Reply