I want to send 2 variables when clicking on a button. below is my code
$value=$document["rootFolder"];
$value2=$document["uploadSize"];
$_SESSION['rootFolder']=$value;
echo '<input type="image" src="images/file2.png" class="btTxt submit" width="85" onclick="myfunc('.$value2.','.$value.')"><b> '.$value . "</b>";
echo "</tr>";
}
below is my fuction:
<script type="text/javascript">
function myfunc(size, fname){
var name=fname;
var m = parseInt(size);
var size2 = (m).toString();
alert(name);
Why am I not able to call the 2nd parameter that is fname? This works fine when I pass only one parameter that is size.
echo "<input ... onclick='myfunc($size, \"$value\")'>...";It's way better to assign the click handler with JavaScript though.