-1
I don’t have much knowledge of Javascript. I need to convert this check below that is in PHP to Javascript.
How can I do that?
$verificao = $_POST['verificacao_name'];
$pesquisa1 = $_POST['p1'];
$pesquisa2 = $_POST['p2'];
if (($verificacao == 2) and
(($pesquisa1 <= 8 and $pesquisa1 != 0) or
($pesquisa2 <= 8 and $pesquisa2 != 0) or
($pesquisa3 <= 8 and $pesquisa3 != 0))) {
echo 'Erro';
else{
echo 'Ok';
}
And the
$_POST['verificacao_name'];
is what in Javascript?– Sergio
It is a select for yes or no. If he chooses yes he has to perform the function, if he chooses No, he does not have to perform. Sorry not to comment on this :/
– Eduardo Santos
And what do you want to check on that select? what is
'p1'
?– Sergio
I think it would be better to say what you want to do in Javascript.
– Sergio
P1 is a value from 1 to 10. If it chooses verification = 1 (yes), it has to execute the if I quoted in the question. If <=8 does not let go, it must return false.
– Eduardo Santos
I need to do that if in Javascript, got it?
– Eduardo Santos
And where does that come from
P1
select also? can display the object that would be the$_POST
?– Sergio
With the data coming via post
– Eduardo Santos
The if is exactly the same... the question is what do you want to do instead of
echo
.– Sergio
How so "data coming via post"?
– Sergio