Posts by koioc • 126 points
8 posts
-
1
votes1
answer74
viewsA: Get specific JSON value
The photo path is inside Details, at position 0 of the array. console.log(data.details[0].caminhofoto);
-
0
votes1
answer47
viewsA: add select field dynamically (Laravel project)
Use the function .clone() of Jquery, create a select with the default options without id and hidden to serve as a basis, so when you click on the add it copies this select and displays on the…
-
0
votes1
answer79
viewsA: run a script automatically
You can use the event focusout to execute as soon as the input is populated and lose focus $('#inputId').on('focusout', function() { //código a ser executado }); or use the keyup that always runs…
-
3
votes1
answer1128
viewsA: How to change the class of a component in Html using Javascript?
Select the element and change the attribute className document.getElementById('showmodal').className = "modal fade";
-
2
votes3
answers411
viewsA: Pick last element attribute date from a list
Use the function .last() $("#botaoexemplo").on("click", function() { var contagem = $('.dd-item').last().attr('data-id'); contagem++; $("#dd-list-geral").append('<li class="dd-item"…
-
1
votes2
answers898
viewsA: HTML/JS/PHP: Transform date entry into dd/mm/yyyy
With PHP it is simple to solve, just convert your base to input format $dataBanco = "06/04/2018"; $data = date('Y-m-d', strtotime($dataBanco)); echo $data;…
-
1
votes1
answer500
viewsA: I am unable to load the image that shows error using jQuery
Include the image path in the same statement to capture the error event $('img').on('error', function(){ $(this).attr('src', 'img/erro.jpg'); }).attr('src','img/img_nao_existe.jpg');…
-
0
votes1
answer76
viewsA: Running PHP commands saved in Mysql
From what I understand you want to execute commands saved in the bank, for this just use the function eval() who receives a string as parameter and executes it as code PHP $foo = "bar"; eval("echo…