Jump to content

Syntax Issue


dizzy1

Recommended Posts

Hi, I always seem to manage to spend most of my time fighting syntax.

 

I simply want to have an onclick which calls AddDrink and passes two variable into a string. But the onclick='AddDrink("+title+","+drink+")'; wont work.

 

 

The Full Function:


function getFunction(title,drink){

HtmlString = "";
HtmlString += "This is a Test";		    
HtmlString += " <a href='#' onclick='AddDrink("+title+","+drink+")'; >Add</a> <br> "; 	  

return(HtmlString);

		 }

 

Link to comment
https://forums.phpfreaks.com/topic/203293-syntax-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.