Posts by Caique Romero • 7,039 points
223 posts
-
10
votes1
answer793
viewsA: Split in single quotes '
The way it is you will generate a syntax error. You can take a scape \': string[] resultado = x.Split(new char[] { '\'' }, StringSplitOptions.None); Console.WriteLine(String.Format("Resultado:…
c#answered Caique Romero 7,039 -
1
votes5
answers273
viewsA: Taking html class with PHP variable in javascript
An alternative solution is to name the class that comes from PHP in the value of a <input type="hidden" /> and in the Javascript get the name of this class: HTML: <input type="hidden"…
-
5
votes2
answers9062
viewsA: Concatenate text to an existing SQL column
Use simple quotes to concatenate the text 'KG' SQL SERVER: Beyond the function CONCAT() you can use the + to concatenate the current value of the column with KG: UPDATE tabela SET peso = peso + 'KG'…
sqlanswered Caique Romero 7,039 -
2
votes1
answer53
viewsA: Error while performing Javascript summation
Your variable $row is returning to <div> wrong and so you can’t find the elements inside her with the .find(). Change of var $row = $(this).parent() for var $row = $(this).parent().parent();…
-
3
votes1
answer154
viewsA: Block mouse scroll in Javascript
You can hide the scroll when the mouse passes in a certain area, in my example I put to hide the overflow while passing the <div id="azul">. var azul = document.getElementById("azul");…
-
3
votes1
answer2635
viewsA: SQL SERVER - RELATIONSHIP 1:N
To answer your question in a more didactic way, I’ll take a simpler example of a relationship 1:N. Imagine that you went to a laundry (shop) to wash your T-shirts and at the time of leaving them you…
-
1
votes3
answers737
viewsA: Temperature converter
To convert Fahrenheit in Celsius, subtract 32 and divide by 1,8. °C = (°F 32) 1, 8 See Example: #include <cstdlib> #include <iostream> #include <conio.h> #include <string.h>…
-
1
votes6
answers1028
viewsA: How to subtract an array
I created a function that takes two lists of objects and a property, how it works: For each iteration of the first list I run the second comparing the received property, if this property does not…
-
2
votes2
answers77
viewsA: Selectlistitem with custom attributes
The solution I found was to pass the list of customers through a viewData[] and create the <select> directly on View. ViewData["Clientes"] = new Business.Cliente().Get(idDistribuidor); I went…
-
5
votes6
answers2555
viewsA: How to change the title element text?
You can store the current content of the element <small> in a variable and after changing the content of <h1> adding the variable. var ano = $("small")[0];…
-
2
votes3
answers1479
viewsQ: Expand options of a select element by clicking button
It is possible to force the display of the options of an element <select> through javascript? The idea is to simulate a user’s click on select. Imagine that I have one select disabled, and by…
-
0
votes1
answer85
viewsA: Make an httprequest call with Curl
You can use the .html() for this, just take the value at each change in the checkbox of the bet classes and type and assign the checkbox value marked to the column of the ticket table desired:…
-
1
votes2
answers6651
viewsA: Select higher value from the latest date
You can search for the highest value by using MAX(Valor) and use uppercase HAVING together with a subquery to bring only the highest values of dates that are equal to the highest dates of each…
sqlanswered Caique Romero 7,039 -
0
votes1
answer389
viewsA: Change title color in google graphics
If you throw the dice in the same row yourself API distributes the colors of the bars and their respective titles, but if you want customize you can through the options of the method Draw(): var…
-
2
votes2
answers77
viewsQ: Selectlistitem with custom attributes
I created a DropDownList by the method below: private void PopulateDropDown() { //Chamo o método que obtém a lista de clientes da API List<Models.Cliente> clientes = new…
-
1
votes2
answers469
viewsA: Show and hide according to another event
I added a class to the elements you show/hide. By clicking the button I hide all elements with .Hide() and then I only show what was clicked: // Função do button Mostrar/Esconder do card…
-
3
votes1
answer54
viewsA: Form validation does not work with jquery
You must inform within the rules which field should be validated. Change of field to the name of the element you want to validate, example: email: {required: true,email: true} In case you wanted to…
jqueryanswered Caique Romero 7,039 -
0
votes2
answers75
viewsA: Add SUM() to querry results
To sum up the value, I linked the two tables through a LEFT JOIN and sought SUM(ContractValue): DECLARE @mes int; SET @mes = 1; WHILE (select @mes) <= 12 BEGIN SELECT…
-
6
votes3
answers582
viewsA: How to remove spaces before and after a string without the Javascript "Trim()" method
I see no need to reinvent the wheel, the Javascript already has a native function to accomplish this and it is already "approved" and tested. Below is an example with method Trim(): console.log((" X…
-
4
votes5
answers8190
viewsA: Onclick event in image
The onclick works perfectly on one element <img>, the problem is that your image is contained in a <a>, then when you click runs the click on link. Following example: function…
-
5
votes2
answers3367
viewsQ: What are the differences between Viewbag, Viewdata and Tempdata?
I was researching how to pass data to a view, or rather, persist the data of a controller to the view. I would like to know among the 3 forms cited in the title: What are the differences between…
-
1
votes2
answers758
viewsA: Count radio inputs that are :checked
I basically changed the dial to get the <input> for name and bring only checked. Then I check the marked values and increment the variables inteiro and metade. function resultado(){ var opcoes…
-
0
votes1
answer119
viewsA: Split Property of the JS
You are trying to access a position of the "names" array that does not exist, so it is not possible to do the split. Change the repeat loops by removing the equal sign = for (var i = 0; i <…
javascriptanswered Caique Romero 7,039 -
1
votes1
answer1078
viewsA: Take html array value with Javascript
Yes it is possible, you can do it as follows: var textarea = document.getElementsByName("arraytextArea[]"); //Caso não queira o primeiro textarea basta iniciar a variavel i com 1:…
-
0
votes2
answers66
viewsA: Select with Join does not return results
An alternative solution using LEFT JOIN SELECT * FROM livro LEFT JOIN passador ON livro.id = passador.fk_livro_id WHERE passador.fk_livro_id IS NULL…
sqlanswered Caique Romero 7,039 -
1
votes2
answers79
viewsA: Why does removing javascript not work?
I changed your code so that the <button> dynamically created will call a function by passing this (the button itself) as parameter. onClick="RemoveLinha(this);" And I created the function…
-
1
votes4
answers534
viewsA: Help with distinct
Using the same logic of MAX() and Group By I made another solution alternative with subselect: SELECT DISTINCT(C1.nome) , ( SELECT c2.data FROM Cadastro AS c2 WHERE c2.situacao = MAX(C1.situacao)…
-
3
votes1
answer3065
viewsA: Javascript Discount
First change the calculation of the instalment payment of: valor * 0.5 //50% do valor. To: valor * 0.05 //5% do valor. Second, avoid the use of variables such as x, y, z this makes it difficult to…
-
3
votes3
answers657
viewsA: Changing the pointer on a bootstrap-datepicker
My answer is very similar to the others uses the same concept of changing the cursor, but I do it for jquery: Just add the snippet below: $( ".ui-datepicker-trigger" ).css('cursor','pointer');…
-
0
votes1
answer137
viewsA: Cannot serialize Member * because it is an interface
From what I understand the problem WebMethod is not able to serialize an interface, i.e., it is not able to serialize the class coming directly from the Entity. To fix the problem I created a class…
-
0
votes1
answer137
viewsQ: Cannot serialize Member * because it is an interface
Staff bumped into above error while trying to create a webservice and I’m having a hard time interpreting and treating him. Detailing what I did: Within a project InpartSaude.WebApi.Api in one of my…
-
2
votes2
answers3273
viewsA: Carousel Bootstrap does not work
Review the libraries you are using and check their dependencies, in the case of bootstrap you need to include the library jQuery first: Bootstrap Some plugins and CSS Components Depend on other…
-
1
votes2
answers61
viewsA: Filtered data within the combo
A way to relate a select with another can be by adding one personified attribute in the options of your select secondary school. In the example below I create the attribute data-categoria in the…
-
-1
votes4
answers1103
viewsA: SELECT with two results
If you wanted to specifically display the list of a given name and then the rest of the data, as in the example you quoted. You can do it through marriage( UNION ) of two consultations. But for the…
-
2
votes1
answer2459
viewsA: How to use the merge statement in sql server
By definition the command MERGE: Performs insert, update, or delete operations in a table destination based on the results of the junction with the source table. For example, you can synchronize two…
sql-serveranswered Caique Romero 7,039 -
2
votes2
answers66
viewsA: Query between tables
One way you can do to achieve the result is to compare the columns and with CASE WHEN returning 1 for equal values and 0 for different, in the end just add the return of each comparison, follows…
-
4
votes2
answers133
viewsA: Any difference between the two expressions?
In the first impression there is only one assignment the p receives the value of u int p=4,u=12; System.out.println(p=u); Resultado: 12 In Second Impression there is an attribute but you make use of…
-
2
votes2
answers299
viewsA: How to move the position edges after the Hover?
You can put the effect after the :hover using ::after or ::before. Following example: div.classe { position: relative; float: left; padding: 0 10px; width: 80%; height: 100px; background: rgba(38,…
-
1
votes1
answer81
viewsA: Html "Double" Select required
The only solution I know is through Javascript. I created a method that will run every time one of your select is changed, it will receive the id and the value of elemento altered. If the elemento…
-
3
votes4
answers7563
viewsA: How to include and manipulate local JSON file?
In case you didn’t want to use JQuery can access the file using Xmlhttprequest(): var getJSON = function(url, callback) { var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.responseType…
-
1
votes1
answer1573
viewsA: Upload image only when you click a button to display
You can add the src image or variable as an attribute of an element and by clicking it create the element <img> through javascript, follows an example: function CarregaImagens(divDestino,…
-
2
votes1
answer6140
viewsA: Create new table from another in sql server
The correct syntax is SELECT colunas INTO tabelaNova FROM TabelaQueDesejaCopiar WHERE Condicao SELECT... INTO creates a new table in the default file group and inserts on the lines resulting from…
-
1
votes1
answer905
viewsA: Problems validating longer than final start date
You are comparing texts and not dates, so the comparison does not return the expected result. I created a function to convert the text to date based on the image you put in your question, that is,…
jqueryanswered Caique Romero 7,039 -
1
votes3
answers455
viewsA: LINQ with JOIN and Where clause, how to do?
As has already been said in another reply, to carry out the LEFT JOIN you will need to use the Instruction Defaultifempty. Below is the code snippet: public class PessoaController : Controller {…
-
2
votes1
answer45
viewsA: DOM Jquery does not work with form
The problem is that you are capturing every click on the element with id reg-form_3 what happens is that this element is the form, IE, every time you click on the form your script will be executed.…
jqueryanswered Caique Romero 7,039 -
0
votes1
answer350
viewsA: Update in stock table
You can put the UPDATE in your php after the INSERT executed, example: After the INSERT in the table Regentradanutricia: $sql = "UPDATE StockNutricia SET Quantidade = Quantidade +" . $quantidade . "…
-
3
votes1
answer239
viewsQ: Links and images menu with float
I tried to create a menu with html and css without any framework, I used float:left to place the image with the logo on the left and rest of the images that are anchors should be on the right but…
-
1
votes3
answers72
viewsA: I calculate between two inputs and result in another
First I put an equal name to all input and added different classes for each block. In the function I identify to which class(block) the changed input is intended and so I know that the total of that…
-
1
votes3
answers55
viewsA: Relationship between tables varying according to value
I used the JOIN and in the clause ON i check for both columns if the reference exists or if and value is null: Sqlfiddle - Online Example SELECT * FROM nfs n JOIN nfs_item ni ON n.id = ni.nfs_id…
sqlanswered Caique Romero 7,039 -
4
votes4
answers60985
viewsA: Difference between :disabled and :readonly in HTML?
readonly This boolean attribute indicates that the user cannot modify the value control. HTML5 This attribute is ignored if the attribute value type for Hidden, range, color, checkbox, radio, file…
htmlanswered Caique Romero 7,039