I'm doing a like/dislike system. Here's the html code:
<form method="post" name="ratings">
<input type="submit" name="vote" value="like">
<input type="submit" name="vote" value="dislike">
</form>
In my index file, if I do
var inputValue = req.body.vote;
console.log(inputValue);
I get either "like" or "dislike" depending on the button I click. However, I can't seem to use this value. Like if I try using an if statement with this value, I get true regardless of what I compare it to. For example:
if (inputValue = "random") {
console.log("random");
}
random is returned in console, even though req.body.vote == "like" or "dislike".