I made a hidden button having the value of image name the user will be uploading. So, for example, if a user uploaded an image named as "1.jpg" that should be the value of the button.
I have another button having a value="LIKE" which is shown on the image when a user hovers over it. I wanted to trigger the hidden button when the user click on the LIKE button.
Here's the code for the hidden button:
echo "<td><form method='post'><input id='hiddenButton' type='submit'
name='hiddenButton' value='$row[1]' /></form></td>";
Here's the code for the LIKE button:
echo "<div class='middle'><div class='likeButton'><form method='post'><input
class='likeButtonStyle' type='button' value='LIKE' name='like'
onclick='document.getElementById('hiddenButton').click()' /></form></div>
</div>";
How do I know the hidden button is not triggering? Because if it triggers the whole page should be refreshed because of the:
<input type="submit" />
BTW all this code comes under the PHP tags.