Questions tagged as 'if'

3
answers

Selecting the src of an input using ID in JQuery

if(!$("#src-img[src='']")){ }else{ }; I would like to know what is wrong with this selection in if, in case, I want, if a value is set in the src attribute, it executes if, otherwise else. * That's why I put the '! '     
asked by 22.12.2016 / 17:58
5
answers

Verify that all $ _POST was sent without using many ifs

Good morning, I have to check if all fields of the form, sent as $ _POST, have not been blank, this is until I solved it. But I wanted to see a way to not need to use many if / elif to check every index of $ _POST would: if(empty($_POST['no...
asked by 22.06.2018 / 16:06
2
answers

Function discovers greater value among JavaScript variables

I have the following form: <body> <form name="questao1" method="post" onsubmit="sendToDB();"> <br><input type="checkbox" name="Q1[]" value="Enfermagem" onclick="getPontos(1)"> Garantir a saúde das pessoas...
asked by 03.12.2016 / 21:10
2
answers

Display the largest and smallest values between two integers when they are different from each other

I can not display the lower and upper values.    Make an algorithm that reads two numbers and indicates whether they are the same or, if different, show the largest and smallest in this sequence. int V1,V2; printf("Valor 1 :"); scanf("%d"...
asked by 14.09.2018 / 14:33
3
answers

If with 3 conditions and at least 2 true?

Suppose I have the following if if(a || b || c == true) In this case, if only one of the values is true to activate the condition, but I would like the condition to be activated only when at least 2 of the past values are true, is it...
asked by 02.03.2018 / 21:33
2
answers

Validate the return of select PHP

I am making a select and before printing the form on the screen I would like to validate if the select returned lines, as I do this I tried in several ways without success. $stmt = $dbh->prepare($fat_ped_online_vende); $stmt->execute();...
asked by 20.01.2017 / 18:17
1
answer

PHP - Why should I put an IF in mysqli_prepare ()

In the example discussed in the PHP Manual , if instructions. I know that if is used for comparisons, what comparison is being made here? Here is an example from the website below: <?php $mysqli = new mysqli("localhost", "my_user", "my...
asked by 26.07.2016 / 20:46
1
answer

Accept uppercase and lowercase character

I'm making a rough draft just to train if and else that will be a subject in my next college class. I want to get there and at least already have a base of what the teacher will teach. My question is as follows. When I ask th...
asked by 02.09.2018 / 19:43
1
answer

How to use multiple conditions within an if

I have tried in many ways, grouping with () of all the ways that I imagined, creating a variable and calling it in the condition etc, but I can find where I am wrong. $(function() { $('#id1').change(function(){ if (($(this).v...
asked by 19.07.2015 / 07:46
2
answers

PHP parametric functions

I'm new to php and I'm creating a comparison of box sizes, and for that I'd like to put inside a function but I do not know which parameter to put inside the function's relatives. Someone could help me, Thanks. <?php include("caixa.php");...
asked by 21.05.2015 / 17:49