Posts by Diego Souza • 16,524 points
642 posts
-
2
votes1
answer64
viewsA: Pass an array of a form to PHP via AJAX
You can do so, with a counter on JS <input type="text" name="dados[][nome]" class="form-control" value=""> <input type="text" name="dados[][faixaetaria]" class="form-control" value="">…
-
1
votes1
answer842
viewsA: Span alignment with css
.container { left: 0; right: 0; margin: 10px auto 10px auto; width: 95%; border-radius: 4px; background:…
cssanswered Diego Souza 16,524 -
2
votes1
answer82
viewsA: How to join arrays in ascending order with Unique array
$cars = array("Volvo", "BMW", "Toyota", "BMW", "Ferrari"); $cars2 = array_unique($cars); $cars2 = array_values($cars2); print_r($cars2);
phpanswered Diego Souza 16,524 -
1
votes2
answers807
viewsA: Open Popover by clicking the tab and closing only by the button
You can use the event show.bs.popover $(document).ready(function () { $('#Responsivo').popover({ //trigger: 'manual', placement: 'bottom', html: true, title: 'O que é um site ou software…
-
5
votes1
answer2635
viewsA: Check if a value is inside an array
JS var cep = '13426000'; if(arrayCeps.indexOf(cep) > -1){ console.log('Tem no Array'); } jQuery if($.inArray(cep, ArrayCeps) > -1){ console.log('Tem no Array'); } PHP With in_array($valor,…
-
2
votes2
answers923
viewsA: Pass jQuery variable inside Ajax
If you want to pass the form all put data: form, as it already has a global variable. Another thing, in his new FormData it has to be like this: form = new FormData($('form')[0]); You have to place…
jqueryanswered Diego Souza 16,524 -
2
votes3
answers24310
viewsA: How to check if a String is empty in Javascript?
Length checks how many characters it has. if(pessoa.nome.length == 0) If you have 0 it’s because it’s empty. Or you can use exclamation ! to check if it’s fake, if it’s true is why it always has…
javascriptanswered Diego Souza 16,524 -
3
votes1
answer1005
viewsA: Ajax Synchronous Xmlhttprequest
You have to make one Callback. The code does not wait for Ajax to finish, it is asynchronous. Would that be: var o = 0; $.ajax({ url : url, dataType : "json", async : false, success :…
-
4
votes1
answer674
viewsA: Install Laravel Site on Windows Server
To host Laravel in Windows you must configure the file web.config in accordance with .htaccess for Linux Server. For this you can use a conversion tool .htaccess for web.config that the IIS…
-
3
votes2
answers352
viewsA: Placing scroll in the horizontal
Thus ? A hint is to put the function calc in the width class content-menu: width: calc(85px * 12); You have to calculate more or less the size of each item of the MENU and do a basic multiplication…
-
1
votes1
answer180
viewsA: DIV TEXT Fixed only in DIV PAI space
See if this is more or less what you thought. $(document).ready(function() { var hForm = $('.form'); var hText = $('.text'); var lText = $('.text').offset().left; var tText =…
-
18
votes1
answer100270
viewsA: How to resolve Call to Undefined Function mysql_connect() error
The function mysql_connect() was discontinued. Now it is used mysqli_connect(). $link = mysqli_connect("host", "user", "pass", "database"); This also applies to other commands starting with mysql_.…
-
4
votes1
answer2234
viewsA: My bootstrap carousel isn’t working!
You are calling JS files as CSS Styles. Change this: <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css"…
-
1
votes2
answers1025
viewsA: Sum with SUM()
It is necessary to make a DB::raw or you can do using Eloquent. Maintenance is best in the latter case. Fluent DB::select(DB::raw(" Select sum(D.CargaHoraria) as CargaHorariaTotal, C.NomeCurso,…
-
3
votes1
answer2289
viewsA: Add and remove jQuery inputs
I saw two problems in your code. Needs a DIV to involve your text field and your button, this DIV will be Parent and needs to have a class and not a id. The id cannot repeat on the page. So, as it…
jqueryanswered Diego Souza 16,524 -
0
votes1
answer156
viewsA: Sum checkbox with values coming from the Bank
JS - jQuery function soma(e){ var total = 0; var valores = $('input[type="checkbox"]:checked'); $.each(valores, function(i, v){ total = parseFloat(total) + parseFloat($(v).val()); });…
-
3
votes2
answers353
viewsA: How to remove only the parent element, without removing the children
Use the function unwrap() in jQuery. For test purposes I have created a button that does the simulation. $('.ativar').on('click', function(){ if($('p').parent().is('a')) $('p').unwrap(); else…
jqueryanswered Diego Souza 16,524 -
3
votes1
answer368
viewsA: How do I put mascara on input (Total Value)
Apply the mask function after inputar the result in it. document.getElementById('result').value = soma; // Aplica Máscara mascara(document.getElementById('result'), mreais);…
-
5
votes1
answer405
viewsA: Text over div with borders
See if that’s it: .apresentacao { width: 0px; height: 0px; border-right: 100px solid transparent; border-top: 100px solid transparent; border-left: 100px solid #f0ad4e; border-bottom: 100px solid…
-
2
votes3
answers482
viewsA: Why does Angularjs default to # in the URL?
Hashbang, Hash, Junk, Sharp, Hashtag or simply # is who determines which page is being called, that means /#home and /index.html#homeare the same thing, since index is the main file of the…
angularjsanswered Diego Souza 16,524 -
4
votes4
answers130
viewsA: How to format this array?
One way to do it is like this: The $id should be global in this case. If it is can be used like this: function map_nomes($m){ $id = 1; return ['nome' => $m, 'id_assinante' => $id]; } $nomes =…
-
1
votes2
answers230
viewsA: Is there a way to clear the field formatting before going through validation?
Try to use the function all(). public function rules(){ return [ 'razao_social' => 'bail|required|max:128', 'nome_fantasia' => 'required', 'cnpj' => 'bail|required|unique:empresas|max:14'…
-
3
votes1
answer96
viewsA: How to activate the Insert only when you click the insert button
You need to validate the fields. You can do this in Javascript, PHP or both. For example in PHP: if(trim($_POST['quantidade']) == ''){ $error[] = 'Quantidade - Campo Obrigatório!'; }…
phpanswered Diego Souza 16,524 -
2
votes1
answer319
viewsA: How to search for markers already created on a map - Google Maps
Try to do so: var Bounds = osGoogleMap.OSMaps.DublinTheme_wt106_block_wtMainContent_Google_Maps_wtMap_block.getBounds(); var Markers = []; for(var i = 0; i < markers.length; i++){…
-
2
votes1
answer184
viewsA: How to divide a variable into an array
Do so: $var = "8017990310062\r8017990142064\r801792340068\r"; $varRep = str_replace('"', '', $var); $varExp = explode('\r', $varRep);
phpanswered Diego Souza 16,524 -
0
votes1
answer136
viewsA: MAMP - phpMyAdmin - Error
So try the terminal in Applications.: sudo chmod -R 0777 /Applications/MAMP/tmp/
-
5
votes2
answers1008
viewsA: How to Customize Simple Page Arrows?
There is a simple way that this can be done. Since the Laravel Paginate is based on the Bootstrap theme it is possible to change its values by str_replace() of PHP. <?php $pagination =…
laravelanswered Diego Souza 16,524 -
-1
votes5
answers4508
viewsA: Problem in video autoplay
In HTML it’s just autoplay. <video width="99%" height="500" id="video" controls autoplay> <source id="video_player" src="comercial.mp4" type="video/mp4"> </video> And you don’t…
jqueryanswered Diego Souza 16,524 -
1
votes2
answers3430
viewsA: Check if input file is filled
You can check the file size. If it’s 0 it’s because it wasn’t uploaded. if ($_FILES['Arquivo']['size'] == 0)
phpanswered Diego Souza 16,524 -
4
votes3
answers7113
viewsA: Remove space between html list item
Another suggestion is to use HTML comments between LI's to be well-bred. .itens { list-style-type: none; padding: 0; margin: 0; } .itens > li { display: inline-block; padding: 20px; background:…
-
1
votes2
answers983
viewsA: How to force dowload a pdf?
You can create a change function to receive the value of the combobox and make an option check. If you choose yes, redirect the user to the file link. $(document).ready(function(){…
-
0
votes1
answer126
viewsA: Redeem date-id from a menu
To get the ID you can use a Javascript function... But you don’t necessarily need to use a Data attribute since you have the ID attribute. Then you can do whatever you want with it.…
-
2
votes1
answer707
viewsA: How do I publish to a Facebook page using the PHP SDK (5.0)?
You have to generate one Token specific to page. There is on Facebook to do this. After that are the same processes to make a POST on a profile, with the difference in the URL. $fb = new…
-
2
votes1
answer327
viewsA: Javascript to close menu accordion
I don’t know how to do this only with CSS: I only removed the classes that open the CSS MENU and Transitions. I created a JS function. $('.showMenu').on('click', function(event) {…
-
0
votes1
answer205
viewsA: Merge results from two tables
In your table courses ID the primary key ? Because in the WHERE you put a.id_curso. Try it this way: SELECT a.id, a.aula, p. STATUS FROM cursos_aulas a LEFT JOIN cursos_progresso p ON p.id_aula =…
-
2
votes1
answer35
viewsA: Is it possible to store the tmp_name of a file in cookies?
A suggestion is to upload the image to a temporary folder with the image name. When you are actually entering into the database, look in the temporary folder for the image as you have its name in…
-
2
votes1
answer38
viewsA: Increase menu width jquery css
You have to increase the menu width to as much as you want, but you have to put the same menu size on Translate. Where is 200px is the size of the MENU, has to be equal. .pushy-left {…
-
0
votes1
answer67
viewsA: Insert city name in a search box and open map of that city on another page
You can use the Google LINK below without necessarily having an API. The Location variable would be what you type in the field. I made the simple example below that loads the Google LINK with the…
-
3
votes2
answers976
viewsA: Typeerror: $(...). error is not a Function
Change this: $('img').error(function () { }); That’s why: $('img').on('error', function () { });
jqueryanswered Diego Souza 16,524 -
3
votes1
answer103
viewsA: Problem with JS/Jquery/Ajax
Declare this function outside the function searchTradeItems(). $("#alert-ok").click(function() { var iquality = $("#alert-value").val(); $("#alert-box").fadeOut(200); $.ajax({ url:…
-
2
votes1
answer110
viewsA: Bootstrap Jquery error
The jQuery file should always come before any plugin that uses jQuery. Moreover, the code order is fundamental in all programming. <script src="jquery.min.js"></script> <script…
-
2
votes4
answers6187
viewsA: How to pick up element above Jquery?
Just take it for the class. $('.id-task').text(); JS $('#test-task').on('click', function(){ var idTask = $('.id-task').text(); alert(idTask); });…
-
4
votes3
answers368
viewsA: How to align the text in front of another element?
.boxEtapas { overflow: hidden; } .etapas { margin: 0 auto; } .etapas ul { list-style:…
cssanswered Diego Souza 16,524 -
3
votes2
answers1008
viewsQ: How to Customize Simple Page Arrows?
It is very good to use the pagination of Laravel, with a command you do everything: Controller $artigos->simplePaginate(5); View {!! $artigos->render !!} And after that the pagination is…
laravelasked Diego Souza 16,524 -
1
votes4
answers857
viewsA: Compare if variable is number within an if
var chute = Math.round(parseInt(prompt("Adivinhe em qual número estou pensando"))); var numeroPensado = Math.round(Math.random() * 100); if(chute != numeroPensado && !isNaN(chute)){…
-
2
votes2
answers781
viewsA: how to protect access to a php file?
If this request is POST in PHP you can do it first of all: if($_SERVER['REQUEST_METHOD'] == 'POST'){ // Todo seu código } This way by GET it will not be able to access the URL through the browser’s…
-
2
votes2
answers1150
viewsA: Group items by month and count them
To return 0 you have to array to do the months combo. Otherwise you can create a table for months and do a Join. $vendas = Encomenda::select(DB::raw('MONTH(created_at) AS mes, count(id) AS qtd'))…
-
6
votes1
answer144
viewsA: Alignment of <pre><code> elements in css
Put a class to the <pre> containing the property below: white-space: pre-line;
-
10
votes1
answer144
viewsQ: How to adapt my code to Android 4.1?
I’m making an app using Materialize. But a mistake is happening. The MENU is to work as in the second image. It is hidden with a TranslateX(-100%). And when I click on the MENU icon it opens the…
-
5
votes3
answers3023
viewsA: Foreach Array incrementing another array
$arrayForm = array(); foreach($array['quantidade'] as $key => $val){ $arrayForm[] = array( 'quantidade' => $val, 'produto' => $array['produtos'][$key] );…