Posts by Matheus • 1,783 points
80 posts
-
0
votes2
answers1168
viewsA: How do I validate Cpf for my database values?
You could check the CPF informed by the client with a JS function. Would look like this: <script> function validaCPF(cpf) { var numeros, digitos, soma, i, resultado, digitos_iguais;…
-
5
votes3
answers2170
viewsA: Pass values from a popup (child) to parent page
Assuming you have these inputs in the popup: <input type="text" id="email" name="email" class="form-control"> <input type="text" id="senha" name="senha" class="form-control"> <button…
-
1
votes2
answers10008
viewsA: Add a value to a JSON object
var a = 12; var b = 3; var obj = { c: 11, d:22 } obj["a"] = a; Following example: https://jsfiddle.net/oo6fodmd/…
-
2
votes2
answers529
viewsA: How can I automatically send my input information via javascript?
You can use onKeyUp to check how many digits the client has already typed and after 8 digits, submit the form. Would look like this: <input id="edValue" type="text" onKeyUp="ValueKeyPress()">…
-
1
votes4
answers1343
viewsA: Plugin bootstrap-material-datetimepicker disable days of the week
Using Bootstrap 3 Datepicker v4 do eonasdan, they already implement the functionality to disable specific dates, for the user not to select. Follow the plugin:…
-
1
votes1
answer580
viewsQ: How to send an object between controllers via Redirect
How to send an Object through redirect between requests? I performed tests trying to send the object through the model, but without success. Follows the code: @RequestMapping("removeResultado")…
-
7
votes1
answer2978
viewsQ: Pagination with large amount of data
Thinking about performance, what is the best way to paginate a large amount of data? I’m currently wearing a List<Produtos>, keeping around 500 products in it, and using subList(min,max),…
-
2
votes5
answers7927
viewsA: Take name and surname of a string
You can use JS Split to take the name and surname of the string from its spaces. Would look like this: var nomeCompleto = "Renan Rodrigues Moraes"; var nome = nomeCompleto.split(" ")[0]; var…
javascriptanswered Matheus 1,783 -
5
votes1
answer614
viewsA: Seeking Active Threads
Well, I found the solution by assigning each thread created to a List array, where I later check if it is active, taking each thread from the list. The Code was like this: List<Thread>…
-
4
votes1
answer614
viewsQ: Seeking Active Threads
I have the following problem, where I have one for() that opens 17 threads and needs to recover, in another thread ( 18ª ) the active threads that I opened earlier and verify which of the 17 are…
-
0
votes1
answer238
viewsA: Changing information within the same modal
You can use Jquery Ajax, so that when the user clicks on one of the buttons, ajax looks for the text elsewhere and inserts it into a div, without the page having to give a Reload. Follow a practical…
-
1
votes1
answer243
viewsA: Why does 'window.Alert()' work in tabbed navigation and 'window.Focus()' does not?
Is there any other way? Well, you can use a Notifications api to generate a desktop notification for the user. A quick search by google, I found a question asked in the American stackoverflow,…
-
13
votes2
answers791
viewsQ: Approve or refuse a request through Handlerinterceptoradapter
It is known that all requisitions by @RequestMapping are "public", where any user can access them through the browser. The question is, how to approve Requests where only the system can request and…
-
4
votes4
answers8025
viewsQ: Searching dates through BETWEEN AND
I have the following situation, where when trying to query a date by another date using BETWEEN, the specified deadline does not return, only "the previous day". Is there an outline to address this…
-
0
votes2
answers68
viewsA: find() is not searching for all input’s
Given your Code, a simple manteira to check all types of input and the rules you want to apply. Also, in the case of input text "inside" the radio input, which needs to be selected to validate it, I…
-
2
votes3
answers1261
viewsA: How to make the background inside a div occupy the whole body
The idea is to fix the background on the body and center it, where it will not be resized when zoomed. Would look like this: body { background: url('https://algumaimagem.jpg') no-repeat center…
-
3
votes2
answers135
viewsA: javascript Prevent from Submit
You can use the javascript method Event.preventDefault() to prevent the default event from running Follow a practical example: $("a").click(function(event){ event.preventDefault(); }); A little…
-
2
votes2
answers419
viewsA: Hibernate ORDER BY ASC|DESC does not work by passing parameter
Well, I solved my problem as follows, concatenating the filter directly into the query: String filtro = "nome DESC"; //ou "nome ASC" Query query = manager .createQuery("select t from ProdutosVO as t…
-
1
votes2
answers419
viewsQ: Hibernate ORDER BY ASC|DESC does not work by passing parameter
Well, I’m having a problem ordering a query, where I’m passing the name of the field along with ASC or DESC as parameter for the query, however Hibernate is not finding itself, returning the query…
-
2
votes1
answer197
viewsA: What is the difference between . data() and Jquery.data()?
The only difference between .date() and Jquery.data() is that Jquery.data is a method of low level, compared to .date(). Comparing the code between the two, .date() is much more usual. See the…
-
0
votes2
answers268
viewsA: How do I limit the rotation of prefabs on 2 axes in Unity?
First you should take the Y rotation of the object and check the rotation value with the established limit, where if it does not exceed the maximum value established, the object can continue…
-
0
votes1
answer57
viewsA: Onmouseup() method does not work in unity4
According to the Unity documentation, so that the event Onmouseup function, the same must be in an object containing a Collider or Guielement. For more information, follow the documentation:…
-
13
votes2
answers29411
viewsA: How to export a DIV HTML to PDF by rederizing CSS?
Update Based on the following reply, adapted the script and created a extended function of JQuery to facilitate the creation of PDF’s based on HTML. The script provides creating pages multiplies if…
-
1
votes9
answers2096
viewsA: How to assign a function with parameters to click without executing it?
The way I found to add a function at the click of a element, without calling this function when assigned, is adding a Eventlistener. element.addEventListener(event, function, useCapture) However to…
-
0
votes1
answer177
viewsQ: What is the best way to hide visible JS functions when specifying HTML?
I have some Javascript functions in my pages that were previously inserted directly into jsp, within the tags <script>. I later changed them to a.js file where I just import the functions. I…
-
0
votes2
answers671
viewsA: Submit DIV over another DIV
The solution is to render the HTML of the processing modal after the registration modal. To organize everything, follow example: <div id="modalCadastro"></div> <div…
-
0
votes3
answers1203
viewsA: How to update the table (bootstrap-table) via JS after registering?
Well, you can use an ajax request for the register (Form), where the return of this ajax will be the list of the updated table, so you only need to update the table fields with the return of ajax.…
-
0
votes1
answer81
viewsA: API Distancematrix - Get travel time information
"So how do I get the duration without considering the traffic?" Your answer is in your question. On the return of the google maps Api, it returns the same 31 min shown in your image. "Duration" : {…
-
3
votes1
answer2470
viewsA: Find nearest Google Maps addresses
One solution is to consult the API with each ZIP code saved in the bank (Destinations), with the EPC informed by the customer (rigins), save to a list and sort at the lowest distance value. To limit…
-
0
votes1
answer713
viewsA: Javascript and Unity 5 : What is the error of the code? (Animations jump and fall)
function Update() { // Verifica se deu start if (Controle.Start == true) { // Caso sejá apertado a tecla Space executa a ação "Pule" if (Input.GetKey("space")) { …