Posts by Sam • 79,597 points
3,121 posts
-
1
votes2
answers138
viewsA: Delete Full user
The Submit button needs a form with a action. You are using a Submit button without form and the direct action on the button, which will not work. And missing send via GET the value of deleta which…
-
1
votes1
answer73
viewsA: Error in Json passage
The problem is that you used the wrong syntax on the line: datatype: 'json', The correct is camelCase: dataType: 'json', Since the syntax is wrong, the return comes as a normal string, and not as a…
-
0
votes1
answer58
viewsA: Functions with ajax
You can do it this way: Put a class in the forms you want to send via AJAX. For example, .form-ajax, and also the action where it will be sent (no need to id nor of method): <form…
-
1
votes1
answer211
viewsA: How to close Bootstrap Modal?
The dark background behind the modal and above the general content of the page is a div with class .modal-backdrop which is generated when the modal is opened. When the modal is closed, this div is…
-
2
votes1
answer92
viewsA: .clone() not registering Select value in cloned DIV
You need to pull the values of the cloned element selects to the clone selects. After the line that makes cloning (var cont = $(".duplicata").clone();), change the values of the clone selects by…
-
2
votes2
answers305
viewsA: Concatenate URL(Search)
With Javascript you can concatenate the input value to the attribute action form as you type (event keyup): <script> document.addEventListener("DOMContentLoaded", function(){ // aguarda o DOM…
-
1
votes1
answer148
viewsA: Back to previous page
By submitting the form, you are redirecting to index.php?sucesso=1. You can use the parameter ?sucesso=1 to open the second div directly instead of the first. Since you are using a plugin, it only…
-
1
votes1
answer42
viewsA: Table does not add last request
Your problem is that the code data[i].projeto can come with spaces in case of Aplicativo Mobile, there is a space between the two words, and by assigning this to a id will invalidate table id this…
-
0
votes1
answer681
viewsA: How to give refresh in modal bootstrap after closing?
Just apply a .reset() form inside the modal and empty the field #recuperarSenha when the modal is closed, through the event hidden.bs.modal: $('#login').on('hidden.bs.modal', function(){…
-
4
votes2
answers915
viewsA: How to keep the data filled in <input> after clicking send the data?
Can use localStorage to save HTML. O localStorage is a kind of cache generated by Javascript in the browser that stays permanently. Even by closing the browser you can recover the data saved in it.…
-
1
votes3
answers144
viewsA: HTML Doubt Send text from an inputtext to php
Note that in the Hidden input you set "nume" as value for the field: <input type="hidden" name="numerotelefone" value=nume> The onClick="document.formulario.numerotelefone.value =nume" input…
-
0
votes1
answer210
viewsA: How do I get the toggle menu to close when clicking and take me to the beginning of the section correctly?
Close Ollapse in the same event that makes the animation, before the animation: $('a[href*="#"]:not([href="#"])').click(function() { $('.navbar-collapse').collapse('hide'); // AQUI!!! var target =…
-
0
votes1
answer48
viewsA: Autocomplete works, my problem is with jquery switches for dynamic fields
Just search for the elements that are in the same div .row. Use .closest(".row") to select the entire row and the .find() to find the desired element. For example, to select and change the value of…
-
2
votes1
answer27
viewsA: Implement jquery script in modal box
Note that you are repeating id’s in the fields. In addition to being incorrect to repeat id’s, events where you listen for id’s will only work in the first elements that have id’s. Exchange all…
-
1
votes2
answers69
viewsA: Summing Table Line Values
An option using jQuery and formatting the result with two decimal places is using in the calculation result: .toLocaleString("pt-BR", { style: "decimal", minimumFractionDigits: "2"}) Create an event…
-
1
votes1
answer865
viewsA: Show file date in PHP
The variable $data is static taking only the date of the folder assigned in the variable $path. Use the function getMTime() to take the dates of the last file modification and format them with…
-
1
votes2
answers255
viewsA: How to make a horizontal line between two <td>?
There is a way to do this by placing the line in the first cell of each line instead of the last one, as you are doing. And putting the text inside a span with a background equal to the cell…
-
1
votes1
answer46
viewsA: TR data-id coming Null Jquery
The $(this) in var id = $(this).attr("data-id"); is not referring to the element clicked as the event in onclick is just calling the function. The function, in turn, has no way of knowing which…
-
3
votes2
answers30
viewsA: Remove white spaces between tds
The browser applies in table one border-spacing (space between the edges of the cells) standard 2 pixels: Just change this value to 0 using the table id: #tabela{ border-spacing: 0; } Behold:…
-
1
votes1
answer625
viewsA: Close a modal BOOSTRAP and open another one then?
When closing the modal with $("#login").modal('hide'), use the event callback hidden.bs.modal to open the other with $("#cadastro").modal('show');. Note that Bootstrap 3 only works with jQuery from…
bootstrap-3answered Sam 79,597 -
0
votes1
answer104
viewsQ: How to create a triangular progress bar with borders?
I’m trying to create a progress bar that has the format of a rectangle triangle, as in the image below: It’s actually a div with the size of 70% x 50px and a 1px border, and a pseudo ::after with a…
-
1
votes2
answers77
viewsA: Scroll through text and link word - Jquery
You can do this without using jQuery, just with replace, because the replace only replaces the first occurrence you encounter. As the question does not indicate how the words are selected, in the…
-
1
votes1
answer44
viewsA: Viewport width disregarding body scrollbar
You need to reset the margin of the body, otherwise it will be included in the Divs calculation, making them not fit in the body width, because the vw will take the full width of the window (without…
-
1
votes1
answer54
viewsA: Multiple Choice Fade Effect Quiz
From what I understand, just get the main div of the group of radiobuttons with id that begins with quiz and change the opacity to 1. For example, when you click on a radio, you search for the div…
-
1
votes2
answers516
viewsA: Array.push() always stacking the last foreach item
Another way is to convert the object line in string at each iteration of forEach using JSON.stringify() and parsing with JSON.parse(): data.push(JSON.parse(JSON.stringify(line))); With this you will…
-
1
votes2
answers92
viewsA: Ajax does not send data to php!
You need to use the callback success, and instead of done, use complete. The callback of complete is executed after passing through the callback of the success: ,success: function(response){ // faz…
-
0
votes2
answers70
viewsA: Css or Javascript problem that only works in Firefox
It should not work in any browser, because there are errors in the code, for example in these lines: div1 = document.getElementById("div1"); div2 = document.getElementById("div2"); There is no…
-
1
votes1
answer92
viewsA: jquery.inputmask.Bundle.js duplicating the pressed characters
Apply the mask only when the element receives the focus, and put false in the option of clone(), so that it does not duplicate the events (by the way, leaves no option, because false is already the…
-
2
votes4
answers137
viewsA: Change word by clicking the same word. Javascript
You don’t need id. Use the this which references the element itself. And as our friend said in his reply, you can use the ternary operator: <a href="#palavra" onclick='var t = this.textContent;…
javascriptanswered Sam 79,597 -
2
votes1
answer31
viewsA: Problem filling HTML table
The value of cell in the forEach of Object.keys(row) returns only the object’s key names. To get the values of each key you need to use the key bracketed notation in cell of the variable row:…
-
3
votes1
answer606
viewsA: Translation of html page
Save the id on a sessionStorage and when opening the page check if it exists and fire the translation. Create an anonymous function that does the translation and saves the id to a cookie…
-
2
votes2
answers61
viewsA: Catch value in Javascript/Jquery loop
Since you’re using jQuery, could you use the .each(): $(".pai .filho").each(function(){ var teste = $("img", this).attr("alt"); console.log(teste); }); <script…
-
0
votes3
answers91
viewsA: How to call a function through a button using querySelector?
Your code is correct, except for the syntax error in Var, that would be all in tiny: var. Note the Javascript syntax, which differentiates upper-case from lower-case letters. When using Var the…
javascriptanswered Sam 79,597 -
2
votes1
answer49
viewsA: download by changing href dynamically
Use the method .on() jQuery that fires the event only once. When firing the event, also change the attribute href with the return of Ajax, also enter an attribute onclick pointing and firing a click…
-
2
votes1
answer70
viewsA: Change text position in text area
Place the text "Message" inside a label and use the property vertical-align: top through a class. Behold: .valign-top{ vertical-align: top; } <textarea rows="3" class="notes" id="mensagem"…
-
2
votes1
answer33
viewsA: Click run suggestion function
Just call the function search() at the end of the event function click of the virtual keyboard buttons, since it triggers the suggestions: $(document).ready(function(){ $('#teclado div…
-
3
votes2
answers110
viewsA: Loop Javascript for (...)
Not to sound like a copy, I was writing this reply when the other one was published, and that’s what was said. The onload is asynchronous and the for performs all interactions before, returning the…
-
2
votes1
answer677
viewsA: Change color of an html table field according to php database status condition
You can add a class to td ending with 0 or 1. For example: "<td class='fundo". $res['campo que retorna 0 ou 1'] ."'>".$res['protocolo']."</td>"; And in CSS you create the style of the…
-
1
votes1
answer283
viewsA: Add variable inside tinymce editor
Instead of using .tinymce('insertText'..., use the command mceInsertContent: tinymce.activeEditor.execCommand('mceInsertContent', false, ` ${this.innerText} `); Will insert a text at the position…
-
1
votes4
answers47
viewsA: Help with responsiveness and alignment
Just add a float: left in the pits (class .actionBox) that they were lined up next to each other. How you just put max-width in the class, the boxes will be the width of the contents, so one may be…
-
1
votes1
answer50
viewsA: CSS and BOOTSTRAP No Margin Image
Your code failed to load the Bootstrap . css. Also, you placed two elements body, and the first within the head. The basic structure of HTML is like this: <html> <head> </head>…
-
2
votes1
answer156
viewsA: Filter elements if child element of elements has a certain class
Use the method .has(), searching for elements that have child elements that match the specified selector. The line .filter( "." + active ) searches for Ivs that have a class, then switching to:…
-
0
votes1
answer74
viewsA: Clear List after Request via JS Dropdownlist in Cascade
Before making the append, you must empty the dropdown. You can do with: $('#TabelaProjeto').empty(); Put the code above before the for. The .empty() empties the element, that is, removes all content…
-
1
votes1
answer56
viewsA: How do I take the position of a marker on a map and adc in a text field automatically each time I place this marker?
Note that the value of e.latlng.toString() returns a string in the pattern: LatLng(n1, n2) Where n1 and n2 are numbers that can be negative and have decimal places separated by point. In this case,…
-
2
votes2
answers196
viewsA: How to create a motion script for a div?
Take the keyCode at the event keydown, that are 37 to 40 of the arrows. Then just take the current position of the div and increment or decrease 10px left if the keyed arrow is left or right, and…
javascriptanswered Sam 79,597 -
3
votes1
answer31
viewsA: Error with jquery array syntax
Take the first argument from the function of .each, which returns the index based on 0, place between brackets after Perguntas of the second .each: tblRespostas.find("tr").each(function (i) {…
-
2
votes1
answer230
viewsA: Image does not display in mpdf
Could be two things: The URL https://sistema.site.com.br/uploads/logo/logo.jpg makes a mistake 404 (URL does not exist on the server) or you did not close the style attribute with quotes:…
-
1
votes1
answer39
viewsA: Help to send jQuery cloned inputs to the database
Instead of listing the name, which is more complicated, you can use the name as an array adding square brackets: name="server_down[]" The values will be sent to PHP in array form, where you can make…
-
1
votes2
answers157
viewsA: Align button inside Alert
Place the button inside a div with the class .text-right. This class applies the property text-align: right. For being inline, the button will be right aligned: <script…
-
0
votes2
answers1044
viewsA: Formatting of bootstrap 4 carousel indicators
The indicators (the lines you quoted) are within a list with class .carousel-indicators. Just change the li’s of this element to "polka dots", changing the width and the height equal values and…