Posts by Gabriel Rodrigues • 15,969 points
440 posts
-
3
votes1
answer112
viewsA: Should I keep the void on the link or can I leave it blank?
There is no good reason to use a javascript: pseudo-URL (*). In practice, this will cause confusion or errors. <a href="#"> is a common alternative that can no doubt be less bad. However, you…
-
2
votes1
answer7627
viewsA: Dynamically Open Image in Modal Bootstrap
And very simple, just include the modal, which you can find in the bootstrap documentation and exchange the id’s for class as mentioned by Guilherme Nascimento. After that you will need an event to…
-
1
votes1
answer92
viewsA: Difficulty Bootstrap image menu
To define this behavior you will need Javascript. Since you use bootstrap and it requires jQuery Voce can add this behavior, basically take the image src url and assign the highlighted image.…
-
1
votes1
answer99
viewsA: jQuery discount on quantity
Simple, take the rest of the division by 3, if zero means you can give discount, then just take the total of products and divide by 3 to give the amount of products to be discounted. Example:…
jqueryanswered Gabriel Rodrigues 15,969 -
1
votes2
answers60
viewsA: Datepicker not render next months?
Your problem lies in the onSelect method, when you select the date you try to instantiate again, causing it to move on to the next months. $(".date-picker").datepicker({ numberOfMonths: 3,…
-
1
votes2
answers1860
viewsA: Remove array element
If you want to remove the Array by id or name and not by index of the array you need to search for this value and return its index, php has a native function for this, the array_search, then just…
phpanswered Gabriel Rodrigues 15,969 -
3
votes2
answers29411
viewsA: How to export a DIV HTML to PDF by rederizing CSS?
You can make a good solution by joining jsPDF and html2canvas Example: $('#button').click(function() { var doc = new jsPDF('landscape', 'pt', 'a4'); doc.addHTML($('#conteudo'), function() {…
-
2
votes3
answers566
viewsA: show all options of <select> without scroll bar
You can use the property size to put the amount of options that select will have, only with this all options will be shown, now if you want to remove the appearance of scroll you can add in a parent…
-
3
votes2
answers164
viewsA: Create dynamic form with tags
Allan, since you are using Tinymce you can use a feature of it which are the Custom Toolbar menu button. Within init you can declare the setup and use the editor parameter to insert into the chosen…
-
4
votes3
answers4316
viewsA: Validating select with jquery.validate
Sérgio, to use jquery.validate is very simple, you just need to include the required class in your element and js to call the plugin by passing the selector that is your form. Example: <form…
-
0
votes2
answers5075
viewsA: Get radio button value via jQuery and set in an input text
I will not perform the logic for Voce just pass you the basics to solve, Oce is mixing the concepts of jQuery and javascript, to facilitate declared as much as possible in jQuery. Example: var…
-
4
votes2
answers79
viewsA: Capture the image link contained in html
You can use the Domdocument() and simplexml_import_dom() loop looking for src attribute. Example: $doc = new DOMDocument(); $doc->loadHTML("<html><body>Test<br><img…
phpanswered Gabriel Rodrigues 15,969 -
1
votes1
answer1058
viewsQ: How to add color in the select option’s Hover?
I’m trying to modify the color of the effect Hover, but this only works in firefox. Example: option { filter: hue-rotate(50deg); } <select> <option>foo</option>…
cssasked Gabriel Rodrigues 15,969 -
3
votes1
answer143
viewsA: How to use Session to prevent a modal from opening again?
Has yes you can use sessionStorage; The logic would be as follows, before the modal open you question: // É diferente de true? <- nunca abriu? if(!sessionStorage.getItem("abriu")){ // Abra a…
-
9
votes1
answer9280
viewsA: Import, analyze and extract data from a PHP CSV
To perform the process of reading a csv file in php is quite simple, since it is understood as a simple txt file that performs its separation using the ;, then you could use functions like fopen to…
-
1
votes2
answers902
viewsA: Pick up radio value and pass to an Hidden input with same name
You can do each on your radio input by traversing and transferring the values to the Hidden input. I used Parent() and sibligns to locate Hidden and insert the value. Example:…
-
3
votes1
answer1325
viewsQ: Create Generic type in Arraylist to persist data
I’m having trouble understanding the concept of Dao and how I could create a specific type to store my data, I’m initially using a String Arraylist and need to adapt it to an Object Product…
-
6
votes1
answer1476
viewsA: A real reason to use the data-* attribute in the html element?
When I used HTML4 and its "ancestors", so to speak, I used to declare non-existent attributes that in a syntactic way presented no error, but in a semantic way yes. W3C realized that there were many…
html5answered Gabriel Rodrigues 15,969 -
3
votes3
answers14329
viewsA: How to use the C++ vector class?
It’s not very secret, you use push_back to add values, then you can catch them using Dice or an iterator. Example: #include <iostream> #include <vector> using namespace std; int main(){…
-
0
votes2
answers96
viewsA: Validate username character number
With maxlength you can limit directly in html. Example: <input type="text" maxlength="5">…
phpanswered Gabriel Rodrigues 15,969 -
6
votes1
answer74
viewsQ: Is there a difference in creating HTML elements in javascript?
There is a difference in the creation of HTML elements in javascript ? Example: Like String: document.body.innerHTML += '<h1>foo</h1>'; And with createelement: var elemento_pai =…
-
3
votes2
answers113
viewsQ: How to prevent a plugin from conflicting?
I’m writing a plugin for tables called easyTable. After understanding the basic workings of a plugin and how it can perform a chaining li in the documentation that to avoid conflict it should look…
-
2
votes2
answers1021
viewsA: Problem to get input value with javascript
You can do it like this: function pegaNome(valor) { document.getElementById("aqui").innerHTML = valor; } <input type="text" id="nome" onkeyup="pegaNome(this.value);"> <div…
-
1
votes1
answer423
viewsQ: How can I persist data using Arraylist?
I need my Arraylist data structure to be visible in more than one method of my Products class. This is how I’m working: package estoque; import java.awt.Component; import javax.swing.JOptionPane;…
-
2
votes1
answer1261
viewsA: How to load a table using ajax from datatables?
I just recreated the array by removing CLIENTS using the function $.map. Solution: $(document).ready(function() { data = { "CLIENTES": { "0": { "ID": "1", "NOME": 'GABRIEL' }, "1": { "ID": "2",…
-
1
votes3
answers618
viewsA: How to make certain words within an editable div stay of one color?
You can take the keyup event and search the text if there is an occurrence of the word, existing this word in the text just replace it by replacing it, as the name says, and add some tag to include…
-
6
votes2
answers10585
viewsA: How to select the sibling elements?
You can use siblings as the first name says "brothers". Example: $('#foo').click(function() { var t = $(this).siblings(); // Vai pegar todos os irmãos. var t2 = $(this).siblings('#bar'); // Vai…
-
1
votes3
answers2061
viewsA: Exit button with message
You can include a modal to inform your user if you really want to quit. Example: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> <link…
-
1
votes2
answers1620
viewsA: Compare equal dates in javascript
You need to use the getTime() function to convert to numbers, so that you enter the correct condition. Example: function gerarData(str) { var partes = str.split("/"); return new Date(partes[2],…
-
3
votes1
answer51
viewsQ: Is there a performative difference between on chained with on with multiple events?
I have always used the on with multiple events with the thought that it would simplify my code and make it easier to understand, but from time to time I came across several plugins using the on in a…
-
1
votes1
answer587
viewsA: How to enable tooltip in inputs?
You can do it like this: $('#mytext').popover(); $('#name').popover(); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> <link rel="stylesheet"…
-
11
votes3
answers10205
viewsQ: How to format date in full?
Is there a Java class that works with date formatting in full? For example: Input: [dd/mm/yyyy] 27/02/2016 Check-out: Twenty-seventh February 2016 I tried to: import java.util.Calendar; import…
-
3
votes1
answer1261
viewsQ: How to load a table using ajax from datatables?
I’m trying to load a table using the component datatables. The return of this ajax request is a json object in this format: data = { "CLIENTES": { "0": { "ID": "1", "NOME": 'GABRIEL' }, "1": { "ID":…
-
1
votes1
answer234
viewsQ: How to make a serialize of certain part of the form?
I own a Togglable tabs and would like to serialize the data only of the current index or active tab. This form is "global" so to speak, and this tabs gets inside, an example of this would be:…
-
7
votes1
answer8624
viewsA: Perform action after user stops typing with Jquery
It is quite complicated to identify when the user has stopped typing, what you can do is to put an interval to perform the research of your suggestion. An example of this would be counting 1 seconds…
jqueryanswered Gabriel Rodrigues 15,969 -
5
votes1
answer676
viewsA: How to create an association form (Picklist) in modal?
The whole process is quite simple, first you need to have two select’s with the Multiple attribute and two buttons to carry out the associations, all you will do is take the selected item and add in…
-
1
votes1
answer434
viewsA: How do I remove the square when I click the icon?
This property is called Outline, you can remove it like this: outline: none: a:active, a:focus { outline: none; ie-dummy: expression(this.hideFocus=true); } This form is the most compatible I found,…
-
3
votes2
answers1487
viewsA: How to add sorting indicators to a table?
Right in function makeSortable() identifque o Indice "th" e faca ele receber as classes do font-awesome fa-caret-up e fa-caret-down according to type of ordering (ascending - descending) which is…
-
1
votes1
answer68
viewsQ: Beforepost recording wrong information
In my Delphi application, when breaking an agreement with my Client I must update the operations data! So I start by deleting some customer data, the problem happens right there: procedure…
-
1
votes1
answer565
viewsA: How to disable mouse effects on mobile phones?
As I mentioned above, you can leave disabled by default and only enable resolutions higher than 768px, you can use @media. Example: div { width: 200px; height: 100px; background-color: yellow; }…
-
2
votes2
answers1006
viewsA: PHP - Highcharts - PDF
Unfortunately mpdf does not support javascript, so for you to show a highchart in your pdf you will have to export it in image format. An example of this would be: var hightchart =…
-
0
votes1
answer1357
viewsA: How to use the ob_flush() function to return data to the browser in an animated way?
You can do it like this: PHP: set_time_limit(0); // coloca o tempo da requisição "infinito" ob_start(); for ($i = 1; $i <= 10; $i++): // aqui sera o seu for para enviar o email este envia 10…
-
5
votes1
answer782
viewsQ: How to load blob field image?
I have a binary image of a blob field and I can’t read it. In the database it looks like this: Yes, this is the text image shape. This is how image: I tried several things and the only thing that…
phpasked Gabriel Rodrigues 15,969 -
2
votes2
answers1308
viewsA: Horizontal ruler with text
It can be done like this: .separator { display: flex; align-items: center; text-align: center; } .separator::before, .separator::after { content: ''; flex: 1; border-bottom: 1px solid #000; }…
-
3
votes1
answer77
viewsA: Menu with CSS3 and Javascript
If I understood correctly what you need it would be like this: $('.burger').on('click', function() { return $(this).toggleClass('open'); }); .burger { display: block; position: absolute; width:…
-
3
votes2
answers877
viewsA: How to transform the value of a variable into the name of an object’s property?
ES6 introduces computerized property names, which allow you to do: var a = 'foo'; var b = {[a]: 2}; console.log(b); Reference: Developer Mozilla - Object initializer…
javascriptanswered Gabriel Rodrigues 15,969 -
2
votes3
answers233
viewsA: Filereader or IE9 alternative
You can check if Filereader is browser-enabled and if you are not using an alternative option: if ('FileReader' in window) { // Faça algo se FireReader for suportado } else { // Faça algo caso o…
javascriptanswered Gabriel Rodrigues 15,969 -
6
votes1
answer569
viewsQ: How to reformulate radio and checkbox UI?
I’m using custom radio and checkbox bootstrap, I realized that some customers had difficulties in assimilating who were checkbox or radios and who should perform the action of selected. Example:…
-
2
votes1
answer456
viewsA: How to pass to Array JSON information on Swift
You can create a String array and receive the json result with it and then use it in another method. Declare in global scope, this is at the beginning of class: var texto: [String] = [] Then when…
-
4
votes2
answers5048
viewsA: How to make a progress bar with steps?
I made an example demonstrating how to create your Wizard/breadcrumb. /* Progress Tracker v2 */ ol.progress[data-steps="2"] li { width: 49%; } ol.progress[data-steps="3"] li { width: 33%; }…