Posts by Tobias Mesquita • 22,900 points
750 posts
-
0
votes3
answers672
viewsA: Condition in Where SQL Server
you can make use of the EXISTS condition. SELECT * FROM TabelaTotal TT LEFT JOIN Client Cli ON TT.Id = Cli.FKTT LEFT JOIN Tabela1 CN ON Cli.ID = CN.FK_Cli WHERE CT.Name = 'A' OR EXISTS (SELECT…
-
2
votes1
answer38
viewsA: Click on a centered image and drag it to the left link or right link?
you can monitor the direction to which the circle was moved using the events dragstart and dragend, for this can analyze the properties as x, clientX, screenX. thus in the dragend, you can take…
-
1
votes3
answers681
viewsA: How to check the ID value of a tag and how often does it repeat with Jquery?
the first error in your html, is that your id repeats, Embrese that the id serves to identify the HTML element and not the course. if you need to add values related to your business in HTML, use…
-
0
votes3
answers141
viewsA: Organize object in Javascript
this may not be your case, but maybe you can use the cycle.js, with it you can point to an object reference, and not object in yes. This blibioteca can also be useful if you want to make a…
javascriptanswered Tobias Mesquita 22,900 -
3
votes1
answer50
viewsA: Objects Entity Framework
Tiago, my first tip is about using the Contexto, It is interesting that you do all your operations within the same Contexto and that it lives only to carry out its work... after all DbContext uses…
-
2
votes2
answers426
viewsA: Return when the function is over
If you’re working with Promises, then yours sincronizarCliente return the data already processed or a new Promise. //$q = meu serviço; sincronizarCliente: function (timestamp) { return…
-
3
votes4
answers1784
viewsA: Confirmation of sending email?
As others have said before, the SMTP protocol does not guarantee that the message will be delivered, nor that the Email Client will send a notification that the message has been received. However,…
-
6
votes4
answers1407
viewsA: How to make elements appear and disappear with Js
you can also make this effect only with CSS. div { height: 80px; } div h1 { animation-name: exibirOutros; animation-duration: 2s; animation-fill-mode: both; animation-timing-function: ease-in-out;…
-
0
votes3
answers1905
viewsA: What are the layers of a web application?
I was writing the text below as a comment, but it ended up getting a little long. Something I don’t like in the term 3 camadas, is that I never know if you’re referring to 3-layer or 3-tier, our…
-
0
votes2
answers67
viewsA: Problems with Sort() and knockoutjs
Hello, the funcaoDeComparacao(objA, objB) of .sort(funcaoDeComparacao) expects as return an integer to define the array order. If we compare two objects, the comparison rule returns a small number…
-
2
votes1
answer125
viewsA: Problem with CSS ID Selector
assign a id to the form, then go to reference the same by ID in the CSS. form input { border-radius: 5px; margin-bottom: 5px; } form#vermelho input { border: 1px solid red; } form#verde input {…
-
3
votes1
answer101
viewsA: Problems with sorting an array list
Renan, it’s interesting that you return an integer instead of a Boolean. var nomes = ["Alessandro", "Alessandra", "Alexandre", "Aline", "Antônio", "Breno", "Bruna", "Carlos", "Carla", "Célia",…
javascriptanswered Tobias Mesquita 22,900 -
3
votes3
answers9794
viewsA: Show average banknote result with Javascript
you are adding up the GIFT elements and not your values. var nota01 = document.getElementById('nota01'); var nota02 = document.getElementById('nota02'); var nota03 =…
-
9
votes2
answers42321
viewsA: How to break string, replacing space by line break
you can use a regular expression to replace all whitespace. var texto = "minha linda casa branca".replace(/\s/g, "\n"); alert(texto); P.S: \s is the metacharacter for whitespace. to accomplish a…
javascriptanswered Tobias Mesquita 22,900 -
0
votes3
answers1833
viewsA: Delete Relate Record using Entity Framework
I ran a test here and I didn’t report your problem. In any case I will describe what I did, it may help you. I created the following tables: CREATE TABLE [dbo].[Categoria]( [CategoriaID] [int]…
-
4
votes2
answers4277
viewsA: applicationx-www-form-urlencoded with Httpwebrequest
Dorathoto, initially I can’t see a problem with your code, what I can suggest is that you try to make this request using the Webapi Client. Install the following package: Microsoft ASP.NET Web API…
-
1
votes1
answer690
viewsA: How to Validate Form with Hidden Fields
you can check if the parent div owns the class hide: substitute: function validaform(form1){ /* demais validações */ if(form1.infantil.value == ''){ alert("Selecione um Tema Infantil!"); return…
-
5
votes2
answers670
viewsA: Search within html - no database
has some plugins for autocomplate, but perhaps the HTML datalist itself will be enough for you: var inputs = document.querySelectorAll("[list]"); var onListChange = function (event) { var self =…
htmlanswered Tobias Mesquita 22,900 -
0
votes1
answer51
viewsA: Boot does not work in Setinterval
you need to reload the event after load. You can automate this by using the .on(). then replace in your script something similar to this: $("<selector do botão>").click(function (event) { ...…
javascriptanswered Tobias Mesquita 22,900 -
1
votes1
answer62
viewsA: I want to do a function if(if) next to a muliplication function
you can use the "input" event in the inputs and/or the "change" in the selects to monitor which you want to change value in them, then you can calculate the item value. /* definindo a "classe"…
-
2
votes1
answer371
viewsA: Construction function and function within function
Epifanio, a hint, avoid putting the declaration and functions in the class "constructor", instead make use of the prototype. in the further you can access the properties of the current object using…
javascriptanswered Tobias Mesquita 22,900 -
3
votes2
answers164
viewsA: Create dynamic form with tags
The section below presents some problems, such as the possibility of the cursor after inserting a tag, among others. but basically you will have to send the contents of the div to the server var…
-
11
votes1
answer180
viewsA: "this" a reliable reference?
William, in the following passage: setTimeout(function(){ document.getElementById('result').innerHTML = 'FAIL'; n.q.call(this); },2000); this becomes the current function if you want to take this…
javascriptanswered Tobias Mesquita 22,900 -
3
votes1
answer2138
viewsA: Func<T, bool> and Expression<Func<T, bool>>
Original Response: Why would you use Expression> rather than Func? Both do different things, while the Func<T, bool> represents a code that will be executed, so much so that the code will…
c#answered Tobias Mesquita 22,900 -
1
votes1
answer527
viewsA: How to do a period limited search with datepicker?
You can set the options minDate and the maxDate to do this: $(function () { var data = {}; data.inicio = $("#data_inicio"); data.fim = $("#data_fim"); data.inicio.datepicker({ onSelect: function ()…
-
2
votes4
answers80
viewsA: View form when password is set
use the same property you used in the form to make it invisible... ie the display: document.getElementbyId("cadastro").style.display = "block";
-
5
votes1
answer81
viewsA: What is the best way to assemble this layout?
First, you don’t need Divs/tds to emulate a padding, you can and should use a padding/margin. you can achieve the same result using the following HTML. html, body { position: relative; width: 100%;…
-
3
votes1
answer45
viewsA: Query result with SET STATISTICS
do not believe it is possible, in any case you will achieve the same result by manipulating two variables. DECLARE @ExecInicio DATETIME2(7) DECLARE @ExecTermino DATETIME2(7) SET @ExecInicio =…
-
1
votes2
answers1776
viewsA: Create a table with sorting using Datatable
Unfortunately you will need to use the Datatables API, below is a complete example with the use of all functions/options. which you will need. bore options columns, to the event fnRowCallback and…
-
1
votes1
answer24
viewsA: Iterate collection of objects within another
it’s no secret, just make one go inside the other. var json = { "categories":[ { "id":1, "name":"Best Seller", "childs":[ { "name":"Novidades", "id":2, "parentID":1, "productCount":1 }, {…
javascriptanswered Tobias Mesquita 22,900 -
4
votes1
answer76
viewsA: Set click for elements not yet existing
in this case you can use the event on on the ul and pass the li as second parameter. $("ul").on('click', '.item', function(){ alert($(this).text()); }); in the above example, it will apply the event…
-
0
votes3
answers296
viewsA: Javascript and SQL - Fill out a boleto with data from a row after selecting it
I will suggest some changes, the first is to move the code chunk that mounts the line to another function, we will do this to create a closure, this way it will be easier to pass the data to the…
-
1
votes1
answer172
viewsA: Timepicker in jquery dynamic input
you will need to call the plugin manually after including the elements on the page: . . . divForm.appendChild(linha); $('.inserir_data', linha).datepicker(); . . . note that I am using the variable…
-
4
votes2
answers946
viewsA: AJAX Javascript Pure Asynchronous
you must use the event readystatechange and not the load. In any case, I think it is unnecessary to use the header application/x-www-form-urlencoded, the default multipart/form-data is even better.…
-
5
votes1
answer13610
viewsA: Percentage calculation in SQL SERVER
can do so: DECLARE @quantidade as decimal(13, 2); SELECT @quantidade = COUNT(ID_PRODUTO) FROM PRODUTOS WITH CTE_PRODUTOS AS ( SELECT CODIGO, (COUNT(ID_PRODUTO) * 100) / @quantidade AS PORCENTAGEM…
-
1
votes1
answer115
viewsA: Problem with Javascript validation
mmooser, try to put all the functionalities in an array, then use functions like sort, some, every, reduce to carry out the checks. var nonNumeric = /[^0-9]/g; var funcs = []; var validar = function…
-
1
votes2
answers2640
viewsA: Sum days on input date
taking into account that input[type='date'] stores the date in ISO format, you can do the following: unfortunately the code below will only get friendly in Chromium based browsers, but the logic to…
-
-1
votes3
answers2051
viewsA: Difference between dates on multiple lines
you can do this using a CTE: DECLARE @PEDIDOS AS TABLE( NUM INT PRIMARY KEY IDENTITY, CLIENTE VARCHAR(6) NOT NULL, EMISSAO DATE NOT NULL ) INSERT INTO @PEDIDOS VALUES ('06.028', '2016-02-26'),…
-
4
votes2
answers1285
viewsA: Divide diagonal mosaic in CSS
follows an example using SVG var trapezio1 = document.getElementById("trapezio1"); var trapezio2 = document.getElementById("trapezio2"); trapezio1.addEventListener("click", function () {…
-
1
votes1
answer230
viewsA: Overwrite asynchronous variable
pmargreff, I tried to simulate your problem, I noticed that the ajaxStart is called only on the first request, so use the ajaxSend. Jsfiddle var qtdRegistros = 0;…
-
0
votes2
answers283
viewsA: Scroll of window size
follows an option using CSS, specifically transition and transform. var container = document.querySelector(".container"); var contents = document.querySelectorAll(".content"); var containerHeight =…
-
1
votes1
answer159
viewsA: Sort multiple Object arrays by value
to sort by value while maintaining the relationship with the name, you must assemble an array with your tuples, then perform a Sort... but as we are ordering by value, we cannot accomplish a…
-
2
votes2
answers90
viewsA: Help with @keyframe effect
in your case, all animations have the same duration, what will change is only the delay, then change the following excerpt: * { margin: 0 auto; padding: 0; } body { width: 900px; } .box { position:…
css3answered Tobias Mesquita 22,900 -
2
votes2
answers971
viewsA: Problems with calculations in Javascript
you need to replace the dots and commas, follows an example: // instancie o objeto intl apenas uma vez. var intl = new Intl.NumberFormat("pt-BR", { minimumFractionDigits: 2, maximumFractionDigits: 2…
-
4
votes1
answer887
viewsA: Block site seen by horizontal
Original response: Soen - forcing web-site to show in Landscape mode only <style type="text/css"> #warning-message { display: none; } @media only screen and (orientation:portrait){ #wrapper {…
-
2
votes2
answers503
viewsA: Search in text file and compare with others
you can even do with LINQ, whether using Query Syntax or Method Syntax (which you called lambda), for the sake of readability, I prefer Query Syntax. var lista = new List<string> {…
c#answered Tobias Mesquita 22,900 -
4
votes2
answers8101
viewsA: mask accepting numbers and , with jQuery Mask Plugin
I see that you want a money mask, in this case, masks based on regular expressions are not the best option, between using a specific mask. Jquery Mask Money $(function() {…
-
2
votes1
answer64
viewsA: How to use SQL LIKE
try to use the SqlMethods.Like instead of contains. SqlMethods.Like(p.NFPA_TX_COMPLEMENTO, "%" + q.NFBP_TID + "%")…
-
1
votes2
answers909
viewsA: Generate HTML elements via Javascript
JC, in your example you are forgetting to close the tags, in any case I would use a template to build the HTML. Here’s an example with Handlebars. $(function () { var source =…
-
5
votes1
answer111
viewsA: Div’s coming and going
instead of using margin, you can use position... for animation, use Animation. .container { position: relative; width: 100%; height: 170px; overflow: hidden; } .box { position: absolute; width:…