Posts by Gabriel Rodrigues • 15,969 points
440 posts
-
3
votes2
answers1238
viewsA: Menu in two CSS columns
André, I leave here a good approach when it comes to dropdown with several items, you can put a scroll, this format is almost zero configuration just one more css and works both mobile and desktop.…
-
5
votes2
answers138
viewsQ: Is hibernate considered white box or black box?
From what I understand the frameworks, Black box are known for their ease of use as it is not necessary to understand what is happening inside of it to use, and the white box otherwise, a knowledge…
-
2
votes0
answers375
viewsQ: How to Force Download mpdf Files Using Ajax
I am trying to download pdf files using the library mpdf. Calling the php page in the browser it works normally. Example: require_once 'mpdf/mpdf.php'; $mpdf = new mPDF(); $boleto =…
-
0
votes2
answers561
viewsA: Create header and logs dynamically based on a json
You can also define your table and fill it using the date-* to check the name of the json index, I particularly like this practice because it is possible to refine the population function in order…
-
1
votes1
answer636
viewsA: Script to disable and enable compos with "READONLY" from a Checkbox
You can do it like this: Example: var editar = document.getElementById("editar"); // No click verifico se o editar esta marcado e desativo os // readOnly dos inputs type text…
javascriptanswered Gabriel Rodrigues 15,969 -
3
votes1
answer964
viewsA: Sort a list <ul> by the "value" attribute of <li>?
You can do it like this: Example: $('#ordena-menor').click(function() { $("#list li").sort(numOrdDesc).appendTo('#list'); }); $('#ordena-maior').click(function() { $("#list…
-
0
votes1
answer1539
viewsA: Change span value with jQuery
You can loop your jQuery object like this: Example: $(".teste").each(function() { var valorAtual = this.innerHTML; var valorFinal = calculaPorcentagem(valorAtual, 10); // Faz o calculo aqui.…
-
0
votes1
answer489
viewsA: How to send several variables to another page and return in a div (Jquery)?
The form has the code, data1, data2 and store, but it seems that the variables are not being sent correctly. Check if the identification selectors are in agreement. You can simplify the collection…
-
3
votes2
answers931
viewsA: How to classify a table from A to Z?
You can use my plugin easyTable It comes with sorting by columns you need, search filter in specific columns or in all. To use it is necessary to have jQuery in the project, the link has the form of…
-
1
votes1
answer351
viewsQ: How to create synchronous functions to get the same behavior as confirm?
I’m trying to recreate the javascript native confirm component and came across a question. Example: if (confirm("meu texto vai aqui")) { // Aguarda retorno {true ou false} console.log("faça algo…
javascriptasked Gabriel Rodrigues 15,969 -
0
votes3
answers4243
viewsA: How to check if return from Ajax is JSON or String?
Object.is is not yet supported by all browsers, but you can do a Polyfill for browsers that do not support ES6, it natively compares two objects to see if they are equal, but you can add or…
-
2
votes1
answer1079
viewsA: Problem in modal bootstrap form
You are using two equal id’s, id is unique! in modal and form this register Serva, then you try to give Ubmit with them, if you use Ubmit with "form" or put another id will work. See an example on…
-
0
votes2
answers212
viewsA: Help with json and adodb in PHP
You can turn into Array and then use json_encode. $sql = 'SELECT * BLA BLA BLA...'; if (!($result = $db->Execute($sql))): throw new Exception($db->ErrorMsg()); endif;…
-
1
votes2
answers64
viewsA: Can I only use HTML5 Form Validation for Client-side validations?
No, HTML5 validations are not mature enough to walk alone, and wherever possible ensure maximum consistency in your data by also validating in Javascript. If you understand that the HTML5 form…
html5answered Gabriel Rodrigues 15,969 -
1
votes1
answer151
viewsA: How to set the root Stage of a controller?
I managed to solve, implemented the following method in my main: public void setView(String title, String url) throws IOException { FXMLLoader loader = new FXMLLoader(CobPlus.class.getResource(url +…
-
0
votes2
answers4340
viewsA: Send checkbox with ajax jquery php
From what I understand, in the method submitSuccess is the place where you will collect the form information and send it to php. So let’s go step by step. 1 Step - Pick up all the fields. var data =…
-
2
votes1
answer151
viewsQ: How to set the root Stage of a controller?
I created a login screen that when authenticating redirects to the menu, but calling by the controller does not work. Main: public class Main extends Application { @Override public void start(Stage…
-
1
votes4
answers3166
viewsA: Display error message when typing phone
You can do it like this: document.getElementById('telefone').onblur = function() { validaTel(this); }; function validaTel(el) { if (el.value.length < 8) { alert("Telefone tem de ter 8 dígitos!");…
-
2
votes1
answer56
viewsA: Bar that changes from time to time
You can do it like this: var bar = ['texto 1', 'texto 2', 'texto 3']; var start = 0; function foo() { if (start == bar.length) { start = 0; } document.getElementById('qux').innerHTML = bar[start];…
-
1
votes1
answer89
viewsA: Upload PHP does not send certain files
When I needed to set the maximum upload limit and did not have access to php.ini I decided to set it up in htacess like this: <IfModule mod_php5.c> php_value upload_max_filesize 100M php_value…
phpanswered Gabriel Rodrigues 15,969 -
2
votes1
answer62
viewsQ: HTML5 form validations behave differently in Firefox
I was trying to find a better title for this question, but I still don’t quite know how to explain it, but come on. I have a simple form with three fields, if I miss one of them will be shown a…
-
2
votes1
answer217
viewsA: Jquery Bootstrap closed.bs.Alert
Switch to something like: $(document).on('click', '.alert a.close', function() { alert("OK"); }) See working on jsfiddle…
-
5
votes4
answers1343
viewsA: Plugin bootstrap-material-datetimepicker disable days of the week
Updating I made a pull request to add this option to the plugin, the authors validated and added the version that is already available on the date 04/05/2016. Add option to enable specifi days #98…
-
3
votes2
answers72
viewsQ: How to trigger functions outside the scope of the Plugin?
I am making a plugin that at a certain stage performs a function. Example: <button class="btn btn-warning btn-lg" id="act"> Action </button> (function($) { $.fn.foo = function(options) {…
-
1
votes1
answer191
viewsA: How to verify if the connection has dropped before sending a data via ajax?
It is not in success that you should check if there has been any connection error or error in the server part, you must use the . error of the ajax itself. If you are using jQuery version less than…
-
2
votes3
answers1106
viewsA: Button diagonally only the left side
I used Transform-origin, I could get very close: Example: button { border: none; font-weight: bold; width: 300px; height: 100px; background-color: #DC005E; -webkit-transform: perspective(300px)…
-
0
votes1
answer434
viewsA: Problem with Background Image using Bootstrap 3
From what I saw in the kennel cover has support only in version 49 of Chrome for Android. Lists supported browsers: http://caniuse.com/#feat=Object-fit I believe that the best thing to do in this…
-
5
votes2
answers340
viewsA: How to create fixed header without javascript?
You can do with css yes! The basic: HTML: <header>Menu</header> CSS: header { position: fixed; top: 0; left: 0; width: 100%; } Example of Basic with just a few customizations: /* Header…
-
7
votes1
answer1214
viewsA: Delete repeated values from a variable
You can turn it into an array using the implode() and then use the array_unique() to remove all duplicated words, and then return to normal string using implode(). Example: $exemplo = "exemplo…
phpanswered Gabriel Rodrigues 15,969 -
1
votes4
answers2497
viewsA: How to dynamically change the color of the text based on the background color?
As I could not find this solution in css and I am using jQuery in my project I created a plugin to scan all backgrounds of tr’s and change them according to their tonality. Example: // Alimentando a…
cssanswered Gabriel Rodrigues 15,969 -
2
votes4
answers2497
viewsQ: How to dynamically change the color of the text based on the background color?
I am trying to change the color of the text according to the background in css, I have a list, each line is a color, I need that for light backgrounds the text is black and for dark backgrounds the…
cssasked Gabriel Rodrigues 15,969 -
2
votes1
answer103
viewsA: Check XML with php
You’re getting the index straight, by the way you set up xml you’ll have to go through question to question the answer. Detail, I don’t know if you put wrong xml but it presents some syntactic…
phpanswered Gabriel Rodrigues 15,969 -
1
votes2
answers1915
viewsQ: How to use Directive templateUrl with external controller?
I am decommissioning some components and I am in doubt when creating a controller linked to the template. I have for example the Login screen, in my Directive do:…
-
1
votes1
answer143
viewsA: Inside the ajax I want to create a variable and use it in several places outside the ajax
You can work with promises, a good example would be: var request = function(link, parametros) { return $.ajax({ url: "https://baconipsum.com/api/" + link, dataType: 'json', type: 'POST',…
-
0
votes2
answers1117
viewsA: Row complete the entire screen
You can use the percentage of the viewport vh to make it occupy all the space necessary. Example: <div class="container-fluid"> <header>HEADER</header> <section class="row">…
-
3
votes2
answers3081
viewsQ: How to allow cross-origin requests?
I have an App on Swift that consumes data from an API, on Swift I had to enable on info.plist adding: <key>NSAppTransportSecurity</key> <dict>…
-
1
votes2
answers783
viewsA: How do I use ng-messages to show $http errors?
I managed to resolve, as I am still a young padawan in angular do not know if it is the correct form or an Advanced RTA :) I used ng-class thus: <div class="alert alert-danger"…
-
1
votes2
answers783
viewsQ: How do I use ng-messages to show $http errors?
I am able to use to perform validations of empty input, min of characters and max of characters,example: <form name="myForm"> <div class="input-group"> <input type="text"…
-
4
votes1
answer3440
viewsQ: How to override equals method?
I am trying to overwrite the equals method for instead of validating if an entire object is equal to the other just check if a value this object is the same as the other. Cenário Real: Student…
-
1
votes1
answer140
viewsQ: How to add text at specific position in String Array
Setting: I have a webservice that I use to pick up texts, these texts can be modified by a web interface, but the title of them will always be fixed, so it was decided to insert them directly into…
-
2
votes4
answers24789
viewsA: Menu and submenu with bootstrap
In the documentation shows the basic example of a dropdown in the following structure: li > a > ul > li > + li's ... > /ul /li Where <a> reference the menu <ul> anchorage.…
bootstrap-3answered Gabriel Rodrigues 15,969 -
1
votes3
answers268
viewsA: Stop multiple jquery events
You can take the event type and put in a condition to separate where each event: $('input[name=buscar]').on("keydown keypress keyup", function(event) { if (event.type === 'keydown') {…
-
2
votes2
answers298
viewsA: Prohibit duplicate emails in Mysql using PHP
You can add a pre-validation in php and also add Unique as quoted by @rray, This pre-validation can be elaborated with a unique() array_and some condition validating whether the email is different…
-
4
votes2
answers284
viewsQ: How to use jQuery in MVC Architecture?
We know that MVC is a software architecture standard (Pattern design) which makes a separation of: Vision (User interface), Template (Business rules), Controller that performs communication between…
-
2
votes2
answers318
viewsA: Separate values from each array
It would actually be like this: Using your Example array: $a = [1,2,3,4,5]; $b = [2,4,6,7]; If you want the difference of $b in relation to the $a will: $diff1 = array_diff($b, $a); Which will…
-
10
votes1
answer475
viewsA: What is the difference between array_replace and array_merge?
For associative arrays, which is your example both work in the same way. If you analyze this example by comparing array_replace vs array_marge vs union operator, you will see that each array type…
-
1
votes2
answers1179
viewsA: How to get a specific region from an iframe?
From what I understand, you want to have access to the html of the site loaded by iframe, have several ways to do, one of them would be a stylized selector to access the body of the site from the…
-
36
votes3
answers21328
viewsA: Create HTML element with Javascript (appendchild vs innerHTML)
appendchild vs innerHTML The appendChild does not cause a complete reconstruction of the DOM or even all the elements / nodes within the target. The innerHTML cause a complete reconstruction of the…
-
1
votes3
answers3504
viewsA: How to remove the last character from a field in Firebird SQL
You can use CHARACTER_LENGTH: UPDATE minhaTabela SET minhaColuna = Substring(minhaColuna FROM 1 FOR 4) WHERE Character_length(minhaColuna) = 5 This way only where there are 5 characters will be…
-
6
votes1
answer150
viewsA: What are the rules for building an HTML email?
If we developers find it difficult to have cross-browser compatibility imagine email clients, well, we each implement whatever you want at any time, so in short, you can look for a site that shows…