doforumda Posted April 10, 2009 Share Posted April 10, 2009 hi i want to embed javascript in php code how can i embed the javascript in the following code echo "<tr> <td>".$record['statVal_id']."</td> <td>".$record['firstname']."</td> <td>".$record['lastname']."</td> <td>".$record['region']."</td> <td><input type = 'button' name = 'edit1' value = 'Edit' onclick='javascript(go2Page(".$record['statVal_id']."));></td> </tr>"; Quote Link to comment Share on other sites More sharing options...
jackpf Posted April 10, 2009 Share Posted April 10, 2009 You don't need to put javascript() as onclick is a javascript event, so it's handled by javascript anyway. And by doiing that you're calling a javascript function go2page(). What is it that you want to do exactly? Quote Link to comment Share on other sites More sharing options...
doforumda Posted April 10, 2009 Author Share Posted April 10, 2009 i created a function using javascript i am calling that function Quote Link to comment Share on other sites More sharing options...
doforumda Posted April 10, 2009 Author Share Posted April 10, 2009 i created a function using javascript i am calling that function tell me how can i use quotes etc to embed into php Quote Link to comment Share on other sites More sharing options...
doforumda Posted April 10, 2009 Author Share Posted April 10, 2009 anyone who can solve my problem Quote Link to comment Share on other sites More sharing options...
Axeia Posted April 10, 2009 Share Posted April 10, 2009 I'm guessing you're having problems with the quotes in this bit? 'javascript(go2Page(".$record['statVal_id'].") Use backslashes like this, 'javascript(go2Page(".$record[\'statVal_id\'].") It's explained on http://php.net/types.string Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.