Greetings, May 30th, 2013
I have furnished a few lines of code below as I attempt to build a button with a onclick that calls a function in javascript. I have successfully passed a numeric var, however, when I try to pass a var exampled by below the html source does reflect the var content but it will not pass to the function. After several hours nothing has worked, additionally the function is in the head tag....any ideas??
Appreciatively,
The function
function open_win(i,busname)
{
if(i==0){
$url="http://xxxxxxxxxxxxxxxxxxx/membersacctinfo.php?businessname="+$busname;
}else if(i==1){
$url="http://xxxxxxxxxxxxxxxxxxx/membersprofile.php?businessname=";
alert('test==>'+$url);
}else if(i==2){
$url="http://xxxxxxxxxxxxxxxxxxx/uploadfile.php?businessname=";
alert('test==>'+$url);
}
window.open($url,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no,
copyhistory=no, width=800, height=400", status="no", titlebar="no", toolbar="no", directories="no");
}
</script>
The function call
I've tried the comma and $_POST['businessname'] in the function call and the var itself and it appears in the html source
print "<td><button id='btn1' onclick='open_win(0,$businessname)' Value=''>Account Info</button></td>";
print "<td><button id='btn2' onclick='open_win(1)' Value=''>Business Profile</button></td>";
print "<td><button id='btn3' onclick='open_win(2)' Value=''>Business Preferences</button></td>";