Questions tagged as 'if'

2
answers

How to call a method into an If and Else?

I'm developing software for an MVC (Model-view-controller) design video store and the problem is not calling the save () method and the change () method inside the If and Else on the Save button. If the typocadastro variable is "new" it saves an...
asked by 05.11.2015 / 20:23
2
answers

Problems with if and conditions

I am making a code that gets three values and sorts them from highest to lowest. As a condition, when the numbers are repeated, an error message is displayed and the program should quit. If the numbers are different, it skips this if and...
asked by 09.03.2015 / 12:55
1
answer

IF on POST response function does not work [closed]

I have a POST inside a javascript function and this post returns a function answering the problem and that the IF in the response function is not working <script> $(document).ready(function(){ $("#mlogin" ).click(function() {...
asked by 16.01.2015 / 04:41
1
answer

Performance: switch or if aligned? [closed]

Regardless of language, switch performs better than aligning if s? If yes: why? if ... elif ... elif ... else ... end switch case ... case ... case ... else ... end     
asked by 20.06.2014 / 16:02
2
answers

How to change variable value after the user submits a form?

This code will print <i class="far fa-star"></i> if rowCount == 0 and if > 0 will print <i class="fas fa-check"></i> , after the user submits the form they will not be able to see <i cl...
asked by 25.11.2018 / 19:30
1
answer

I can not validate the image extension using charAt

I'm trying to do a simple validation on the extent of the images that will be uploaded, but it's not working very well so far, could you help me? Follow the code I'm trying to get it to work. var aoptionFoto = document.getElementById("optio...
asked by 14.06.2018 / 09:15
1
answer

Update variable within IF

Good morning, I'm not able to update a variable inside the IF structure and then use it in my code. Here is an excerpt from my code: while ($dado_participante = mysqli_fetch_array($qry2)) { //REGISTRO 0150: TABELA DE CADASTRO DO PA...
asked by 26.10.2017 / 15:34
1
answer

PHP for each with an if rule

I have a table that gives results of paid and unpaid commissions. I want it to only bring the paid, that is, if number_format($row->amount_paid,2) = 0 does not bring this line. <?php $i=-1; foreach($this->rows->r...
asked by 17.02.2017 / 15:10
1
answer

Why are not you entering this if / else? [duplicate]

I run this code and if / else if are not entering. What can it be? import java.util.Scanner; public class VerificaLetra { public static void main(String[] args) { String sexo = " "; String letra; Scanner scan;...
asked by 28.02.2017 / 17:34
3
answers

How to delete a DIV if there is a word in another DIV in jQuery?

I'm trying to do the following condition: $(document).ready(function() { if($("#content .productName").html().indexOf("JBL","Oversound")==-1) { $("#pague-so").hide();} }); In this case, I want the div # pay-so to be hidden if the div .prod...
asked by 23.02.2016 / 13:55