Posts by Taffarel Xavier • 1,327 points
72 posts
-
0
votes2
answers814
viewsA: How to highlight/highlight words in text?
According to your specific problem, the error is , simplesmnete, here: <input type="text" value="codigo" size="25" name="busca"> Replace with: <input type="text" value="codigo" size="25"…
-
3
votes3
answers120
viewsA: Add an item to an array that is inside another array?
Try this code: var logDebug = ["value", []]; logDebug[1].push("novo valor 1"); logDebug[1].push("novo valor 2"); console.log(logDebug);…
javascriptanswered Taffarel Xavier 1,327 -
0
votes1
answer38
viewsA: How to display the line number of a method in Java?
Try this code: System.out.println("Número da linha #" + new Exception().getStackTrace()[0].getLineNumber());…
-
0
votes1
answer80
viewsA: I am new in java and this line of code is giving error
You put: Showmessagedialog, with the' uppercase: Correct: JOptionPane.showMessageDialog(null, "sla"); See the image of the code:…
functional-programminganswered Taffarel Xavier 1,327 -
0
votes2
answers442
viewsA: Turns a field into the required form when select Yes
To the select, the secret is this option <option value="">Selecione</option> How you added the required attribute in select, then the first option must have its value equal to ""; Or…
-
0
votes2
answers692
viewsA: How to create a div with height in percentage?
The parent element must be with the position=relative This way, the child elements can be with the height percentage. Remembering that the parent element should be with the height defined.…
-
0
votes1
answer150
viewsA: Salary form in php
Try this code: https://repl.it/@TaffarelXavier/WoozyAgedFeeds <?php if($_SERVER['REQUEST_METHOD']=='POST'){ $nome=$_POST['nome']; $categoria=$_POST['categoria']; $salario=$_POST['salario'];…
-
1
votes2
answers40
viewsA: How to return a value from a checked column?
Try this code: let inputsCheck = []; $("button").click(function() { inputsCheck = []; $("input[type='checkbox']").each(function(ev, elemt) { if (elemt.checked) { //Se quiser pegar somente o ID e…
-
5
votes1
answer255
viewsA: How to read JSON object name containing special character?
Try: console.log(Object.keys(data['vagoes-cadastrar']).length); In addition, it is possible, for example, to pass palavras chaves (of Javascript, as: for, while, get, typeof) for key names, such as:…
-
1
votes1
answer77
viewsA: Mask problem for input type="text"
Try the code below: //Exibir no formato de data function mascaraData( campo, e ) { var kC = (document.all) ? event.keyCode : e.keyCode; var data = campo.value; if( kC!=8 && kC!=46 ) { if(…
-
0
votes2
answers79
viewsA: Suffering with php Injection PHP Injection
Use the functions of satanização of PHP itself: https://www.php.net/manual/en/function.filter-input.php Example: <?php $page = filter_input(INPUT_GET, 'loadpage', FILTER_SANITIZE_URL ||…
phpanswered Taffarel Xavier 1,327 -
0
votes1
answer60
viewsA: How to send a div via Javascript?
First: since you will want to add the above html every time the user adds a product to the cart, you should create a logic to add an increment, that will be an id -- different, to this attribute:…
javascriptanswered Taffarel Xavier 1,327 -
0
votes1
answer117
viewsA: How to make a Try catch with mathematical operators?
In this case, specifically, I used the repeat control while. Try this code: package testacalculadora; import java.util.Scanner; class Calculadora { public static double somar(double x, double y) {…
-
0
votes3
answers563
viewsA: View information in Modal with foreach
Using Jquery Add: <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"…
-
2
votes1
answer521
viewsA: Create dynamic html through javascript
You can use the tag template: Reference: https://www.w3schools.com/tags/tag_template.asp function showContent() { var temp = document.getElementsByTagName("template")[0]; var clon =…
-
4
votes1
answer75
viewsA: Add, Subtract, Extract Subtotal and Final Total with Javascript/Jquery
The secret is to use: parseint or parseFloat Try this code: <div class="row"> <div class="col-md-2"></div> <div class="col-md-8" style="border:solid 1px #ffffff;…
javascriptanswered Taffarel Xavier 1,327 -
0
votes1
answer159
viewsA: Blur event with next select field
The problem, it seems, is here: $("input[name='txt_dd_n_fogo']").blur( function(){ To perform the same functions you are running using the input type element, you must do the same thing for select…
-
1
votes1
answer54
viewsA: Knowing the input data
Try the code below: var myVar = prompt("Digite um texto ou número."); if(!myVar){ alert("Operação cancelada pelo usuário"); } else{ while(myVar.trim().length == 0){ myVar = prompt("Digite um texto…
-
1
votes1
answer191
viewsA: Open Modal in Tab Closure
Create a variable and store it in localStorage; The first time the user leaves the page, the modal appears, then, at that moment, already saves some data in the localStorage, the next time it is…
-
0
votes1
answer171
viewsA: Media Query with Javascript
Use the event onresize (https://www.w3schools.com/jsref/event_onresize.asp). https://www.w3schools.com/howto/howto_js_media_queries.asp It is executed when the page is resized. You can make logic…
javascriptanswered Taffarel Xavier 1,327 -
1
votes2
answers553
viewsA: React Hooks state does not update
The problem, in this case, is that the function filter returns a new array (according to the condition), so each time that el => el[name] === value || el[name] === parseInt(value) is true, the…
-
-1
votes4
answers84
viewsQ: Show the output of a custom vector
I have a vector with 16 elements. I want to show the elements of this vector using the repetition loop for. Output must be equal to this: A 1 2 3 4 B A 5 6 7 8 B A 9 10 11 12 B A 13 14 15 16 B As…