Posts by Caique Romero • 7,039 points
223 posts
-
2
votes1
answer116
viewsA: Jquery waits for the function to end to display an image. How to resolve?
I made a very simple example, I did not use an array because I found it unnecessary and put a function Callback in the image view, to display the message to the winner after the image display I used…
jqueryanswered Caique Romero 7,039 -
3
votes1
answer755
viewsQ: Get path of valid files with regular expression
Context: I am monitoring file deletion and inclusion actions in a folder through Class FileSystemWatcher with the intention of registering a Log of the actions performed in it. Problem: This folder…
-
2
votes1
answer165
viewsQ: Like search with LINQ using array
Context: I have the following form: On this screen the user can filter materials by some of their properties. The filter highlighted in the image allows users to search for one or more manufacturing…
-
1
votes4
answers4389
viewsA: Select from previous months
I would subtract the date in php and pass to the database the desired month and year of query, preferably in a Procedure. As an alternative I made a query based on yours that will allow you to…
-
1
votes2
answers1318
viewsA: Visibility of Datatables Column
Just set the column(s) you want with "visible": false, inside columnDefs: Hidden Columns Column visibility Integration $(document).ready(function() { var table = $('#example').DataTable( { dom:…
-
0
votes2
answers152
viewsA: What is the reason for the error since Jquery is being imported
Check that all required libraries have been imported and are in the correct order. jQuery Materialize.js Materialize.css Below is an example working: $(".dropdown-trigger").dropdown(); <script…
-
3
votes3
answers136
viewsA: Delay before showing a div
The display is a property that does not allow animation, or the field is visible or not, therefore it is not possible to use the display with the delay. Animatable CSS properties Alternatively you…
-
3
votes1
answer476
viewsA: CSS - When to click change another element
You can do this using the Checkbox Hack: /* Checkbox Hack */ #toggle-1 { display:none; } label { -webkit-appearance: push-button; -moz-appearance: button; display: inline-block; cursor: pointer;…
-
1
votes1
answer340
viewsA: How to compare two Oracle Datetime columns
You can add 7 days which is the equivalent of 168h: Sqlfiddle - Online Example: SELECT * FROM VENDA WHERE (DATA_VENDA + 7) < DATA_ENVIO_VENDA…
-
2
votes1
answer471
viewsA: Calculator in C (Beginner)
You can use a repeat loop or at the end of your code, you can add a if to check if the value contained in the decision variable is equal to two, if the comparison result is true then you can call…
canswered Caique Romero 7,039 -
1
votes3
answers527
viewsA: I can’t put the icon on the right side of the screen, inside a div
Place the icon inside the paragraph. Remarks: The tag <i> shall be affected by the colour defined in <p>, so I put color: initial in the <i>, another alternative is to use…
-
1
votes4
answers949
viewsA: Day and month comparison on SQL Server
I advise to review how the parameter is passed, because conceptually speaking to search between dates you need to receive dates, in case you are deducing somehow the dates. It is even possible to…
-
6
votes1
answer1287
viewsA: Classic Asp Debug with Visual Studio 2017
One way to debug would be to display a message and "kill" the code then so you will be sure that everything has run up to the snippet where you "killed", for example: Response.Write "Rodou até aqui"…
-
2
votes2
answers454
viewsA: How to select the checked input?
Example without using jQuery library: function Exibir(){ var radio = document.getElementsByName("rankeamento_por"); for(i=0;i<radio.length;i++){ if(radio[i].checked){ console.log(radio[i].value);…
-
1
votes2
answers210
viewsA: Cross two tables and link the line from one to the other, forming a third
According to the result you expect it is not necessary to involve a second different table because all the data are contained in the first. What I did below was get the smallest requester id per…
-
13
votes3
answers919
viewsA: How to make a pure css spinner?
There are several ways you can do, below I demonstrated four different types of spinner that I pulled from the following sources: Only CSS loadings spinner Spinkit CSS only loaders Example 1: /*…
-
3
votes1
answer49
viewsA: Column that receives a result if the condition is true
As the condition is the result of comparing more than one column you should make use of one searched case statement, namely, a Case When: Sqlfiddle - Online example: SELECT (CASE WHEN…
-
0
votes3
answers1439
viewsA: Difference between SQL SERVER dates
Using the Datediff() you can catch the difference between dates. The Select below solves your problem for a specific case. Sqlfiddle - Online example: SELECT DATEDIFF( day , (SELECT Data FROM Teste…
-
2
votes3
answers47
viewsA: How to view a given value in a table
Just use the WHERE to filter your query. WHERE: Specifies the search criteria for the rows returned by the query. Sqlfiddle - Online Example: SELECT * FROM Pessoas WHERE Regiao = 'RS'…
sqlanswered Caique Romero 7,039 -
0
votes3
answers239
viewsA: Error searching for field value - Javascript
"Uncaught Typeerror: Cannot read Property 'value' of null" The above error occurs because you tried to access the property value of an object that does not exist, if you are seeking an element by id…
-
4
votes1
answer196
viewsA: Problems with Nan Return in Javascript
The variable numero2 did not exist at the time of parseFloat() so he can’t calculate the way he wants. Altere of: var numero1 = document.getElementById('numero1').value; var numero1 =…
-
2
votes1
answer507
viewsA: How to 'flip" chart of Google Charts?
Just you assign -1 the direction of the axis you want to reverse: vAxis.Direction or hAxis.Direction Indicates the direction in which the values along the axis grow. Specify -1 to invert the order…
-
0
votes2
answers85
viewsA: how to return the last timestamp date by doing group by of the same id in mysql
You can use the MAX() to get the highest date and group by other: Sqlfiddle - Online example: SELECT serial , equipamento , max(data) AS DataMaisRecente FROM cad_checklist GROUP BY serial ,…
mysqlanswered Caique Romero 7,039 -
1
votes2
answers4663
viewsA: Select last record of a table - sql
With the select below you will be able to bring all the data (columns), only of the most recent records of each patient: Sqlfiddle - Online example: SELECT Tabela.Reg , Tabela.Paciente ,…
sqlanswered Caique Romero 7,039 -
1
votes4
answers1977
viewsA: Select All checkbox by clicking a checkbox
Follow below example with your own code, the same worked perfectly. To complement your code I added a check on <tr> of <table>, this way if the user click on the respective line checkbox…
-
1
votes2
answers1010
viewsA: Display rows from a table according to filters
When fetching rows from a table use the .rows thus: tr = table.getElementsByTagName("tbody")[0].rows; And when taking the value of select use the .children instead of using the .innerHtml:…
-
3
votes2
answers133
viewsA: Commit only one element of two with the same name
Add the property disabled in one of them before Submit. Follow similar example to your: $("#cidade").on('change', function() { var cidade = $(this).find('option:selected').val(); if(cidade ==…
-
2
votes5
answers6090
viewsA: Autofocus: position the cursor at the end of the value
The alternative solution I know nay is only with HTML, she also uses the Javascript. Unlike the other solutions in it I manipulate the cursor without overriding the value, using the…
htmlanswered Caique Romero 7,039 -
3
votes1
answer760
viewsA: How to break line within <textarea>
Use the \n to break the line inside the <textarea>: <textarea rows="5" name="pergunta4"> <?php foreach ($avaliadores as $avaliador) { echo $avaliador["nome"]."\n"; } ?>…
-
0
votes4
answers1182
viewsA: Change placeholder by checking radio with jquery
The id defines a unique identifier (ID) that must be unique throughout the document, so you cannot repeat it. Instead of taking your input for id I’ll pick him up by the attribute name. Another…
-
1
votes3
answers86
viewsA: Conditional with if and Else
I’ve split your function into two: Menor() and Maior() so each button will call its proper function. Within each method I check if the field has been filled in, if both are filled in I compare the…
-
7
votes2
answers6239
viewsA: Problem turning input text into uppercase letters
Solutions with value.toUpperCase seem to have a problem that when typing in the field the cursor is reset, this solution alternative treats this problem: function handleInput(e) { var ss =…
-
0
votes1
answer82
viewsA: Merge Names into a line
I made a minimum example, only using the tables necessary to display it to the teachers of the discipline, in this example I make a subselect and concatenate the results in a single line. I…
-
2
votes2
answers160
viewsA: I am unable to copy characters from one string to another
When you are walking the string just check that the character is equal to + and if it is you come out of the loop with a break;. I saw that at the end you were displaying a counter that wasn’t even…
canswered Caique Romero 7,039 -
0
votes3
answers851
viewsA: Add a title to the SELECT tag (without the "Selected disabled" option) without it appearing in the options?
I got the same effect as your image using javascript to change the text of the option that is selected and unbuilt. I used the css below to hide the disabled options when the select is expanded:…
-
2
votes3
answers992
viewsA: Bring the latest record with conditional - Postgresql
I made a subselect to bring the last purchases of each customer product independent, then I made a join with the original table to bring only the results of the last purchase and that this purchase…
-
1
votes3
answers1191
viewsA: How to add one element inside another
The method prependChild does not exist, at least not natively. You can create your own method as an extension of Element.prototype: var t = document.querySelector("#t"); var div =…
javascriptanswered Caique Romero 7,039 -
1
votes2
answers535
viewsA: Search values between two dates in Sqlite
Sqlite uses BETWEEN as stated in the comment, follow example: Sqlfiddle - Online example: SELECT * FROM Pessoa WHERE Data BETWEEN '2000-01-01' AND '2015-01-01' Note: If you tried with BETWEEN and…
sqliteanswered Caique Romero 7,039 -
1
votes1
answer472
viewsA: SELECT TOP that brings all the results, something like TOP all, exists in SQL Server?
The command TOP() aims to limit the returned lines in a set, so it makes no sense to use it to return all rows. TOP (Transact-SQL): Limits the rows returned in a set of query results to a number or…
-
2
votes3
answers624
viewsA: Doubt about recursiveness in C
Code: #include <iostream> int soma(int n){ if(n%10 == n) return n; else return ((n % 10) + soma(n/10)); } int main(int argc, char** argv) { printf("%d\n", soma(327)); return 0; } Upshot:…
-
4
votes2
answers247
viewsA: Tabulated problem in C
The way the printf is only displayed once after the counter exits the repeat loop, that is, when the cont has a value equal to 11. To correct just remove the ; who is after the for(). It goes on as…
canswered Caique Romero 7,039 -
1
votes3
answers241
viewsA: how to pass by value in Javascript
What you need is to make a Deep copy. Other than Shallow copy or blank copy (explained in the reply of prmottajr), you need a copy that is created without any reference to the original data, which…
-
18
votes4
answers40794
viewsA: Convert date from DD/MM/YYYY to YYYY-MM-DD in Javascript
You can take the string and break it parts using the method split() to separate the parts using / as parameter and then sort it in the format you want. In the example below on both day and month I…
javascriptanswered Caique Romero 7,039 -
0
votes1
answer724
viewsA: How to add two events in datepicker?
You can capture all changes with onChange and within it compare the change in value on dates to know which logic to apply. Below is an example with explanatory comments:…
-
1
votes1
answer869
viewsA: window.confirm with custom buttons
There is no native method ready for this, you can make your own or use some framework, I showed below two examples using framework. Example with Sweetalert2: $(document).ready(function() {…
-
0
votes1
answer407
viewsA: How can I remove table row with jQuery
To remove the line just you can use the .remove() that will remove the element that is passed as a parameter of DOM. $(table).delegate( '.tr_clone_del', 'click', function () { var thisRow =…
-
18
votes3
answers285
viewsA: What is the function of #if false in C#?
The #if is a pre-processing directive which allows you to pass parameters to the compiler. When you do #if false ... #endif The compiler understands that nay is to compile/interpret the #if. A more…
c#answered Caique Romero 7,039 -
1
votes3
answers86
viewsA: Problems with SELECT RIGHT JOIN
Another form of solution: You make a query that returns the union of all machine combinations and motif with zero amount (CROSS JOIN) and all machine combinations and reason that have some…
-
2
votes3
answers139
viewsA: Difference between attr=val, attr="val" and attr='val' in Javascript?
My answer is only to complement the others. If you are using the selectors of Jquery it would be interesting to follow the suggested patterns of the framework: Quotation marks jQuery uses double…
-
1
votes1
answer943
viewsA: Dynamic field validation with Jquery.validate()
Think about validating the form as a whole and treat the rules the elements you want to validate, so you apply the .validate() at the <form> and not directly to the element. In your case…