Posts by edson alves • 2,147 points
86 posts
-
1
votes2
answers205
viewsA: Changing the value of a variable when selecting an option
You can add an Event Listener or directly into the element, a call to the form Submit: <form action="#" method="POST" name="filtro"> <select…
-
3
votes1
answer63
viewsA: Print column created in Select in PHP
You need to add the alias in the sub-select result instead of inside it: select inscricao.id, inscricao.titulo, inscricao.orientador, inscricao.email_professor, inscricao.escola,…
-
2
votes1
answer38
viewsA: edge an object that doesn’t exist
You need to add a content, a padding or set a fixed/minimum size to the div. In this case I added a height minimum: document.getElementById("contadorprincipal").innerHTML = "50"…
-
1
votes2
answers2566
viewsA: How to return a JSON in PHP?
You need to add the header for the browser to recognize the format, then serialize the json object: header('Content-Type: application/json'); echo json_encode($result);…
-
3
votes1
answer177
viewsA: create Javascript function for multiple ids
You can use class instead of adding id for each element. The class can be used several times on the page. Knowing where the click was you can navigate through the elements until you find what you…
-
0
votes1
answer31
viewsA: Owlcarousel crash display when Nav back to page
Try using the pageshow event to mount the slider again by clicking the browser back. This happens because the ready event is not triggered when returning to the page.…
-
3
votes1
answer386
viewsA: Add values of 2 fields, click on the button and appear the result in a third field
Your problem is that: At the beginning of the application the following code is executed: soma1 = parseInt(soma1.value); soma2 = parseInt(soma2.value); Assigning the value of parseInt(vazio) to the…
-
1
votes3
answers75
viewsA: Definition of "arrows" in PHP
I’d never thought of it, but I’ve come to the conclusion that nay. Associative arrays do not allow you to get the value of a position by the index it represents, but you can find out which key is…
-
2
votes2
answers335
viewsA: Validation of a form
I find it easier to use the validation of the Laravel. In this case there is already a validation ready: $request->validate(["email" => "unique:contato"]); Then the error messages will be…
-
1
votes1
answer68
viewsA: Counting effect
One option is to create a loop using setTimeout to create a gap between the links. var counter = document.getElementById('counter'); function increment(i, max){ if(i > max) return;…
-
0
votes2
answers253
viewsA: How to read two lines at a time from a text file?
NOTE: The following code does not work very well with very large files and the line break may change depending on the operating system (where the file is), it is just an alternative using some php…
phpanswered edson alves 2,147 -
1
votes2
answers204
viewsA: How to copy content from a div to an input?
It worked, now would be able to update automatically, without needing update the page? because this div becomes a textarea You can add a Listener that observes the modifications in the element and…
-
1
votes1
answer45
viewsA: How to get a path to the date and extension of a file using some PHP function
I made some modifications in your code that should work (I have not tested), the explanation is in the comments of the code, but basically I grouped the files by mes e ano and then I went into each…
-
0
votes1
answer23
viewsA: "Tracking" updates with PHP
You can create a routine that from time to time performs a search on the desired page and checks a change in some tag as needed using this script: https://github.com/tj/php-selector But since it’s…
-
4
votes3
answers5954
viewsA: How to upload to Laravel 5.7
According to the documentation (https://laravel.com/docs/5.7/filesystem#file-uploads), you only need to use the request file function: $path =…
-
3
votes2
answers504
viewsA: Pop up an icon in the middle of my image by hovering the mouse
Your problem is position Absolute, it causes all the icones to escape and appear in the upper right corner. This can be solved by adding position: relative; to the parent container, so:…
-
0
votes1
answer66
viewsA: Minimum date on Ionic Native Datepicker
As the documentation on https://github.com/VitaliiBlagodir/cordova-plugin-datepicker#mindate--Ios-android-windows : minDate is a Date Object for iOS and a millisecond Precision Unix timestamp for…
-
2
votes1
answer1138
viewsA: Pick up specific input value with the click of the button
In the example below I select the input directly by data-quantity, note that I pass the event to the function and from it extract the id of the button target.…
javascriptanswered edson alves 2,147 -
1
votes2
answers27
viewsA: Keeping data in the fields after an action or updating on the page - PHP
The excerpt echo '<option '.( (!isset($_POST['sistema']) && $sistema['Codigo'] == 12) || (isset($_POST['sistema'] && $_POST['sistema'] == $sistema['Codigo'] ? 'selected' : '') ).'…
phpanswered edson alves 2,147 -
0
votes4
answers844
viewsA: How to Make Material Design Style Button Only with CSS
With a small modification in the css and html of the reply @Netinho Santos, I added a JS that causes the effect to occur from the clicked location, as well as in the material... Unfortunately this…
-
3
votes2
answers162
viewsA: Leaving the Jqery foreach
It is not possible for a foreach, but you have other alternatives, such as using the function Every, when returning true, it continues, by returning false it to: hashModens.every(function(item, i) {…
-
0
votes2
answers72
viewsA: Order registration by name in alphabetical order
Hello, It seems you forgot to add some of your tables anyway, you can remove the data already added in the listing with: $(".listagem").html('') And then add again with the same append, for that…
-
1
votes1
answer43
viewsA: Sending via POST differentiated mode
According to this answer: https://stackoverflow.com/questions/168455/how-do-you-post-to-an-iframe You can use the target attribute of your form facing the name of your iframe, it would look like…
-
1
votes1
answer27
viewsA: Change the value of a VUE array by filtering by another parameter
I don’t know anything about Vue but his doubt is more about JS than Vue. You can use a ARRAY MAP. The Array map will return a new array with the modifications you want, in this case, for each item…
javascriptanswered edson alves 2,147 -
0
votes3
answers250
viewsA: How to make an html page start at a certain position?
You want the scroll to already start at a certain position. The section must work: window.scrollTo(0,150) To call it at the start of the run use: window.onload = function(){ window.scrollTo(0,150) }…
htmlanswered edson alves 2,147 -
6
votes4
answers1051
viewsA: Is it possible to change Placeholder in Focus with CSS?
I don’t know a way decent elegant to do this without using js, but if you are very keen to use only css, the gambetosa alternative below should break the branch: .input-holder{ position: relative; }…
-
1
votes1
answer46
viewsA: When changing a certain status, it changes from all
Your problem is on the line $(".status").html("<a href='#!' id='btnAlterar' data-id='<?php echo $csClientes->IdFinanceiro; ?>' class='btn btn-success btn-xs'>Pago</a>"); In this…
jqueryanswered edson alves 2,147 -
1
votes2
answers3375
viewsA: Filter by date in Mysql
Unfortunately I believe that there is no way to bring the results as you wish, but you can use the group_concat() to group the months with a separator and blow up the string in php, which you said…
mysqlanswered edson alves 2,147 -
1
votes2
answers205
viewsA: How to show a div with scrollTop after certain pixels?
You can do what you want with css only, but it won’t work in very old browsers (but nobody cares, the important thing is to run on Chrome). Here’s a tip in case someone needs it: body { height:…
-
1
votes1
answer61
viewsA: Sort mysql search by function
According to my comment, I believe that it would be better for you to adapt the first query to bring the values counted and then sort by them, thus saving several unnecessary queries and…
-
2
votes1
answer329
viewsA: How to turn an Eloquent Collection into a simple array?
You can serialize Models and Collections via the command toArray() In your case I’d be: $roles = Role::all('role')->toArray(); But turning your Collection into array will not solve the problem as…
laravelanswered edson alves 2,147 -
3
votes1
answer117
viewsA: Save to localStorage the position to hold it when reloading the page
You can add a callback that will be called to the end of the animation: //recupera o valor salvo ao recarregar a pagina if(localStorage.getItem('scrollposition')){…
-
0
votes1
answer336
viewsA: How to create and display a list of emails with json output with form information
I believe your problem lies in adding the event to an element that does not yet exist in the gift. To solve using pure js, you could put the event in the document and detect what the target was,…
-
2
votes1
answer38
viewsA: Returning error in insert function
Your problem is on the line inserirIndicado();, the insert functionIndicated expects to receive an instance of indicadoDAO: You can instantiate the class with the code $indicado = new indicadoDAO();…
-
2
votes1
answer563
viewsA: Javascript Image Handler
The module gm is a "wrapper" for Graphicsmagick and Imagemagick for node.js, the great advantage is that it is very fast and allows you to do everything that Imagemagick/Graphicsmagick has to offer.…
-
1
votes1
answer1045
viewsA: Download a file generated in the backend by Angular2+
You can create a blob from Response and download it by opening a popup with the data: import 'rxjs/add/operator/map'; .map((res:Response) => res.text()) .subscribe(response => { if (response)…
-
1
votes2
answers173
viewsA: Check if a registered user in the bank has already registered Cpf
Using form_validation in his Controller it is possible to validate if a value is unique, stating the table and searched value: $this->form_validation->set_rules('cpf', 'Cpf',…
-
1
votes3
answers76
viewsA: How an array comes from the database in an input
You can use a foreach. It would look something like this: foreach($resultado['lanche'] as $id){ echo "<input type='text' class='form-control' name='lanches[$id]' id='lanches_$id'…
-
6
votes2
answers174
viewsA: How to do with CSS Downloader bar with animated background?
I couldn’t find a better fund, but here’s the idea: Use a background animating position with keyframes: html, body { width: 100%; height: 100%; margin: 0; padding: 0; } body { background-image:…
-
0
votes1
answer55
viewsA: Calculate difference between dates and times coming from time and separate dates
The code below should work as you need: <?php //Seta a data padrão pro php reconhecer o formato d/m/Y date_default_timezone_set('America/Sao_Paulo'); //Cria a data de inicio e fim convertendo a…
dateanswered edson alves 2,147 -
0
votes1
answer92
viewsA: I’m trying to replace the letters with numbers and then add them up
With str_pad you can fill a string with the values passed until it reaches the desired size: str_pad($input, 2, "0", STR_PAD_LEFT); the arguments are: input string, number of characters, value to be…
phpanswered edson alves 2,147 -
0
votes1
answer47
viewsA: Convert multi array to json Multi Array
Your problem is that the attributes are private and json_encode cannot extract the values. I see some solutions: json_encode(serialize(get_object_vars($x))); json_encode((array) $x); You could add a…
-
3
votes1
answer58
viewsA: Modal feedback on registration screen
If the goal is just to warn that the field has error, I find it more interesting to change its color and add a message below. Alerts/modals are very boring and in terms of usability is unnecessary…
-
2
votes5
answers2417
viewsA: How do I get the value of an Hidden input with jquery
The :Hidden selector solves your problem. Even, according to the example, it can pick elements with attribute hidden or display:none $('input:hidden').each(function() { console.log($(this).val())…
jqueryanswered edson alves 2,147 -
1
votes1
answer834
viewsA: How to Get Specific JSON Data with Angular 2x?
The map() method invokes the callback function passed by argument to each Array element and returns a new Array as a result. You could use the map array, it loops and returns a new array with the…
-
0
votes1
answer153
viewsA: What is the split method in Ionic for?
The split() method divides a String object into an array of strings to separate string into substrings. The split is not a function unique to Ionic, it is a function of javascript, but is present in…
-
1
votes2
answers3366
viewsA: How to fix error: String data, right truncated: 1406
According to my comment, it is not necessary to loop the data $data just access directly: Note: If I am not prepared to accept arrays this line $dados = ChecklistProtocolo::create($dataInsert); will…
-
1
votes2
answers678
viewsA: How does this < base > HTML tag work?
According to w3schools Tag specifies base URL / target for all Urls relative in a document. There can be at most one element in a document, and it should be within the element <head>.…
-
1
votes1
answer70
viewsA: Clone table with checkbox values
I think I finally understand your question, following modifications: $(".c").click(function(){ var values = $(this).val().split('|'); //define se esta marcado ou não if($(this).prop('checked')){ var…
-
5
votes2
answers826
viewsA: How to make a div appear by following the cursor?
This would be a possible solution, just replace it with whatever you need: $( "#holder" ).on( "mousemove", function( event ) { $("#popover").show().css({left:event.pageX, top:event.pageY } ) }) $(…