Posts by Wilson Faustino • 829 points
39 posts
-
2
votes1
answer190
viewsA: Pass data from one form to another form’s listview
Rayane, you need access to Form1 within the Form2. You can do this by passing the object of Form1 by reference to the creation of the Form2, for example. In the Form1, you create the Form2 thus:…
-
2
votes3
answers51
viewsA: Add values of fields in jQuery
I suggest you do the function somaCampos(), as below: function somaCampos(){ var total = 0; $('div#credit-after input[type="text"]').each(function(){ //Você pode identificar melhor os inputs a serem…
jqueryanswered Wilson Faustino 829 -
0
votes2
answers57
viewsA: Populating dropdown with multilevel json
Bruce, I suggest you make one foreach additional for subcategory within the foreach of the categories, thus: foreach($json2->Categorias as $registro2): foreach($registro2->subcategoria as…
-
3
votes2
answers163
viewsA: How to dynamically increment a JSON.stringify
Levi, I believe if you change the object obj and only use the method JSON.stringify solve your problem. I think incremetar the JSON.stringify would not be a good idea because the return of it is a…
javascriptanswered Wilson Faustino 829 -
1
votes1
answer326
viewsA: autocomplete bring information to 2 different fields
Thiago, first we need to change your PHP result to return a JSON object from an array, like this: PHP while(...){ $return_arr[] = array( 'value' => $row['nome'], //Valor para referência na…
-
2
votes1
answer696
viewsA: SQL SERVER COLLATION PROBLEM
Brian, probably the two databases are in different COLLATIONS. One is in SQL_Latin1_General_CP850_CI_AI and another is in SQL_Latin1_General_CP850_CI_AS (note the endings AI and AS that…
sql-serveranswered Wilson Faustino 829 -
2
votes1
answer329
viewsA: Remove comma from map
Lucas, use .join('') to unite the result of your map, the parameter provided for the join is the separator. personalInstaThumb.innerHTML = `<ul>${response.map((img, indice) => `<li…
-
1
votes1
answer60
viewsA: How to make mysql select pick up data with a list restriction?
Faillen, use the modifier NOT before the IN, since way: SELECT * FROM tabela WHERE id NOT IN (1,2,3,4)
-
0
votes2
answers79
viewsA: Suffering with php Injection PHP Injection
Willian, first, always use Sanitize filters PHP to sanitize variables acquired by POST or GET. Reference: https://www.php.net/manual/en/filter.filters.sanitize.php To solve the problem of…
phpanswered Wilson Faustino 829 -
0
votes1
answer53
viewsA: How to remove an input type select from serialize
Vinícius, I think you should pass the data by POST, however, to quickly solve your problem, you could use the selector :not(). Would look like this: $('form :not(select#data)').serialize(); or using…
-
1
votes1
answer145
viewsA: PHP Excel is exporting data skipping line
Bruno, you are not closing the column tag correctly with the bar! You are doing <td> instead of </td>. Change the lines of: $dadosXls .= '<td>'.$produto['PEDV_CEP'].'<td>';…
-
1
votes1
answer49
viewsA: How to hide gid line with jQuery in checkbox checked?
Try to modify to something like the code below, using $.each(). $('#checkExibirNaoSeAplica').click(function(){ var naoAplica = $(this).prop('checked') $('.validadorDeChecagem').each(function(){ var…
-
4
votes2
answers312
viewsA: Decimal places in Javascript
Multiply by 100, use the function Math.round() and divided by 100. document.write("A média de gerações que se passaram é: " + Math.round(2019/28*100)/100); Reference:…
javascriptanswered Wilson Faustino 829 -
0
votes4
answers67
viewsA: Help with $_SESSION
Only one echo is needed! To make it more readable, do so: <?php session_start(); echo '<span>Endereço para a entrega 01: ' .$_SESSION['bairro'] .'-'.$_SESSION['rua']…
phpanswered Wilson Faustino 829 -
0
votes1
answer73
viewsA: Re-write url with htaccess
The problem is in regular expression! For example, you’re picking numbers with the ER ([0-9]+) in the place where he would come teste-do-primeiro-post, which is a sequence of characters. Generally…
htaccessanswered Wilson Faustino 829 -
1
votes3
answers328
viewsA: Check if the value is contained in Range Jquery/Javascript
//Range var range = [10, 50]; //Range invertido - para teste //var range = [1000, 50]; //Valores para teste var valor1 = 15; var valor2 = 150; //Limites var menor = range[0]; var maior = range[1];…
javascriptanswered Wilson Faustino 829 -
2
votes1
answer57
viewsA: Arduino leds lighting up without pressing the button
@freddoggo, the line below if(digitalRead(button) == HIGH) has to be if(digitalRead(button) == LOW) because any oscillation in the input current ends up generating a false positive for the Arduino…
arduinoanswered Wilson Faustino 829 -
1
votes1
answer321
viewsA: Curl request does not work depending on JSON size
Curl timeout is at 30s, change the line below: CURLOPT_TIMEOUT => 30 for (1800 = 30 min): CURLOPT_TIMEOUT => 1800 Source: http://php.net/manual/en/function.curl-setopt.php Also put the code…
-
2
votes1
answer60
viewsA: Error removing div with Jquery
Friend, there are two problems: the first is that the remove function was inside the add and the second is that you were deleting the reference div (the one you keep inside the 'line' variable. In a…
jqueryanswered Wilson Faustino 829 -
1
votes1
answer31
viewsA: JQUERY - Load in form with editor
Using jQuery, it can be like this: $("textarea#txt1").on('input',function(){ var txt = $(this).val(); var txt_novo = txt.replace(/(^|[\n\r])([\t\s])+/g, "$1"); $(this).val(txt_novo); }); <script…
jqueryanswered Wilson Faustino 829 -
1
votes2
answers72
viewsA: How to assemble a basic Virtualhost to rewrite Urls in my Xampp htdocs project
Duplicate this line and set up as you need in the Httpd-vhosts.conf file. Don’t forget to enable the vhost module in Httpd.conf, release Listen to the port of the new virtual host q vc configured…
-
0
votes3
answers260
viewsA: How do I change the edge color of the input tag when selected
A simple alternative is to use the method toggleClass at the events phocus and Blur. $('input.colorir').bind('focus blur',function(){ $(this).toggleClass('input_colorido'); }); input{ outline: none;…
-
2
votes3
answers82
viewsA: Common conveter array in associative array
If you always have the vector with 'name' and 'value', you can do it more simply: $arrayfields = $node['fields']; $newarrray = array(); foreach ($arrayfields as $item){ $newarrray[$item['name']] =…
phpanswered Wilson Faustino 829 -
0
votes1
answer51
viewsA: How do I add values from different tables?
I think you don’t need this other table. Maybe a view can be useful, depends on your decision. Try the SQL below: SELECT CUSTAS_SOMA, RECEITAS_SOMA, (RECEITAS_SOMA-CUSTAS_SOMA) AS SALDO FROM (…
-
0
votes7
answers4789
viewsA: Force input with a dot instead of an html comma
@Junior, use the MeioMask to the front: https://github.com/fabiomcosta/jquery-meiomask It is very easy to use: <script type="text/javascript"> $(document).ready(function(){…
-
3
votes1
answer89
viewsA: Jquery event click after attribute change
Using JS to call the new page: $(document).ready(function(){ $('#btnContatos').click(function(){ var contato = $('#contatoParams').val(); location.href = '/chat/busca/' + contato; }); });…
-
0
votes1
answer767
viewsA: Error running SUM - SQL Server
Try this, with an external query: select *, sum(horas_uteis) as soma_horas from ( select dbo.FN_CALC_HORAS_UTEIS(s.SolData,min(l.LogData)) as horas_uteis datepart(month,s.SolData) MesID,…
-
0
votes1
answer122
viewsA: file_get_contents($url) Error returned
Replaces the first line of the function by: $content=@file_get_contents($url); Stay like this: function file_get_contents_retry($url, $attemptsRemaining=3) { $content = @file_get_contents($url);…
-
0
votes3
answers191
viewsA: Operations with multiple input js
Barter $(".total_prod").val(v*c); For $(this).parents("tr").find(".total_prod").val(v*c);
-
0
votes3
answers1886
viewsA: Check if a date is valid
Although the object returned by Convert.ToDateTime be the type DateTime, was not used directly from the class DateTime... I guess it could be like this: bool validaData; try {…
c#answered Wilson Faustino 829 -
0
votes2
answers107
viewsA: I can’t add value in Array
<script> var nomes=[]; var i=1; window.onload=function(){ do{ var nome=prompt("Digite o nome para o indice " + i + ":"); if(nome){ console.log("nome[" + i…
-
2
votes1
answer70
viewsA: Use preg_replace on condition
I do not know if it is the best solution, but try to do so in PHP: preg_replace('/>(.*?)</', '@$1<', $XML_HTML);
phpanswered Wilson Faustino 829 -
3
votes3
answers154
viewsA: Count how many days from today to the bank date
If you want to use Mysql itself, sometimes the query is faster, because it does not need manipulation by PHP: SELECT DATEDIFF(NOW(), DATA_TABELA) AS DIFERENCA_DIAS FROM TABELA_DATAS Reference:…
-
1
votes1
answer26
viewsA: Phpmailler Attachment with Tmp name
The addAttachment method declaration is: /** * Add an attachment from a path on the filesystem. * Returns false if the file could not be found or read. * @param string $path Path to the attachment.…
-
0
votes1
answer140
viewsA: Field write float to sql server with c#
Try to pass a parameter, something like this: string sqlQuery = "update tbl_Produto set Lote=@lote, Qtda=@qtda where Cod_Produto=@codigo"; SqlCommand cmd = new SqlCommand(sqlQuery, conex1);…
-
0
votes2
answers90
viewsA: How to leave a radiobutton marked as default on Ember
Try to add checked="checked" just on the radio you want
-
4
votes3
answers2728
viewsA: How to select this piece of text in Regex
Dude, run through the lines and apply: ^\s*[0-9\.]*\s* This regex removes what you want... only it has to be rotated line by line, with a FOR or WHILE and giving a replace of the value found by ''.…
regexanswered Wilson Faustino 829 -
1
votes1
answer828
viewsA: Variable within GET Ajax Request
Man, the method $.getJSON is asynchronous. That is, you end up using the id in the method $.ajax before the previous method sets a value for the ID variable. Try to make a $.ajax parameter async:…
-
-1
votes6
answers2500
viewsA: Hover on DIV1 change DIV2 with CSS
Try: #div1:hover + #div2 { background-color:red; } or #div1:hover ~ #div2 { background-color:red; } Take a look at:…