Posts by Felipe Duarte • 6,284 points
276 posts
-
0
votes2
answers144
viewsA: Calling method in the action of a form that invokes which page should be redirected
I fixed the various errors I found, probably work that way. <?php function paginaDestino($edtMFIR){ $conexao = new bancodedados(); if(!empty($edtMFIR)){ $conexao->setSQL("SELECT * FROM…
-
1
votes1
answer622
viewsA: Javascript Doubt - Center Image
lacked the property center function clickImagem(src) { $('#conteudo').css('background',"url('"+src+"') no-repeat center"); } .conteudo-externo{ width:500px; height:500px; z-index:3; background:#f1f;…
-
5
votes3
answers539
viewsA: Increment input values in +1 containing letters and numbers using Jquery?
Use split (explode) and join (implode) var str = "ABC-7852"; var res = parseInt(str.split("-")[1]) + 1; res = "ABC-" + res; console.log(res);…
jqueryanswered Felipe Duarte 6,284 -
1
votes4
answers2092
viewsA: Null values in PHP
I believe the best way is with false, because it has no type restriction $valor = [0, null, false, '']; foreach($valor as $v){ if($v == false) echo 'null'; } /* Resultado null null null null */…
-
1
votes1
answer575
viewsA: Run javascript after PHP
Your button of submit is out of the form, to store place it inside the tag form, if this affects anything in your layout, submit through the example javascript... <!--FILTRO FLUTUANTE -->…
-
1
votes1
answer357
viewsA: Centralize text and change JSP CSS color
#menu{ background-color:#6495ED; text-align: center; padding: 10px !important; } .conteudo{ display:…
-
1
votes2
answers650
viewsA: Object orientation with jQuery/Javascript
It’s interesting to think of J-query as an object-oriented javascript ally, but it makes no sense to mix J-query in things that aren’t related to DOM manipulation and event manipulation. Think of…
-
1
votes2
answers60
viewsA: I would like a tip on checked, select option as I do to clear the fields if a person selects an option
I believe that this cleaning involves validation, and only clearing the field will not prevent the submission of it, the ideal would be something like this... $(document).ready(function(){ var cpf =…
-
0
votes3
answers312
viewsA: Validate three fields
You can submit if form != $invalid, example <form name="form"> <md-input-container > <label>Numero1</label> <input required="" name="numero1" ng-model="obj.numero1"…
-
0
votes2
answers787
viewsA: Reset option select
Just reference the select in the function, and use selectedIndex to restore. function alterarStatusFunction(val){ op = val.options[val.selectedIndex].title; if(op == "aprovado"){ if (confirm('Tem…
-
0
votes2
answers773
viewsA: Ng-repeat with div
Are you wearing the diretivas of angular material, therefore any css structuring it will ignore, your code is correct, but if there is an exception in flex="25", the next element goes down (from…
angularjsanswered Felipe Duarte 6,284 -
3
votes2
answers138
viewsQ: how to work with SASS/LESS in real time?
I recently paid attention to pre-processors of css as less and sass because I saw advantages in using them, but I see the need for a workflow so that the css generated is compiled automatically. At…
-
0
votes3
answers1306
viewsA: Browser compatibility with javascript
Use J-query is already a strategy for the code javascript run in multiple browsers even the old ones, but of course there are some exceptions like when the browser is prehistoric or when the user…
-
4
votes1
answer74
viewsA: Search within two arrays
To get all occurrences of the concatenation of the 2 arrays, just join them in this way... var comprimentos = new Array('OI', 'OLA', 'IAI', 'BLZ', 'TESTE', 'TUDO BEM', 'JOIA'); var int = new…
-
0
votes2
answers346
viewsQ: Main differences between structuring CSS with PHP and LESS/SASS
In many projects I’ve been writing CSS with PHP, what is a practice well unknown but that meets all the needs of dynamization, example... CSS <?php header("Content-type: text/css"); $cor_fundo =…
-
0
votes1
answer604
viewsA: Add to cart with Ajax without updating page - Laravel
If you update and appear it means you have already implemented this function, then just pass this amount to the client, to update cart with the method html of J-query, example... in /Cart/add return…
-
3
votes2
answers249
viewsQ: Input elements outside the tag form
I wonder if it is considered a bad practice input attributes outside of the tag form. In w3schools The brand <form> is used to create an HTML form for user input. The element <form> may…
htmlasked Felipe Duarte 6,284 -
0
votes3
answers119
viewsA: How to style the field where the options of a tag select are?
It’s almost impossible to style options free form, each browser understands its styling differently, in addition it accepts few style properties, the solution adopted by UI frameworks like...…
-
1
votes1
answer80
viewsQ: Open in certain photo, Slick Carousel
It is possible that when opening the slick carousel, given photo is in focus? some kind of index mapping or even by name, if not, there is some other slide drag and drop What does it do? example...…
-
1
votes2
answers369
viewsA: Should I use form or div?
Tags form, intend calls HTTP, there is no sense using them for other purposes, in requests ajax it is interesting to use them in a Progressive Enhancement MDN that is, if the browser does not…
-
1
votes2
answers126
viewsA: Take over positions of an array after comparison with another array?
Just make sure results exists if there is no dados exceeded... var dados = [ {idEmail : '1'}, {idEmail : '2'}, {idEmail : '3'}, {idEmail : '4'}, {idEmail : '5'}, ]; var results = [ {idEmail : '1'},…
-
0
votes2
answers5228
viewsA: Example login with javascript
The right thing would be... function Login(event) { event.preventDefault(); var usuario = document.getElementsByName('username')[0].value; usuario = usuario.toLowerCase(); var senha =…
-
1
votes1
answer578
viewsA: Compare two object arrays?
In comp.push({ id: results[a].idEmail, caixa: results[a].box }); Your key is referred to as id and in condition is treated as value sure would be if (comp[l].id === dados[l].idEmail &&…
-
2
votes1
answer104
viewsA: Hide validation message after form submission, Angularjs!
The correct way to restore and validate an angular form is with ng-messages angular.module("seuApp", ["ngMessages"]); Where your form is referenced in controller for name example... <form…
-
1
votes3
answers543
viewsA: Show or hide a div as selected option
False case hide again... if(document.getElementById("nivel_acesso").value != "0" && document.getElementById("nivel_acesso").value != ""){ document.getElementById("hidden_div").style.display…
-
0
votes2
answers3283
viewsQ: Pass whole javascript variable to php
I would like to know why the following section does not work... <?php $window = '<script>document.write(window.innerWidth)</script>'; //exemplo de saída `string(50) "1366"` if($window…
-
1
votes3
answers230
viewsA: Changing button span through jQuery
When using the html all content is replaced, so you should re-place the span´s. success: function(retorno) { var button = $j('button[name=cartaoMensagem' + product_id + ']'); if($j(button).text() ==…
-
0
votes3
answers1468
viewsA: Add a div by clicking the button
The best angular shape is using templateUrl, when necessary it carries the html desired to ng-include, follows an example... Adding plunker template…
-
0
votes2
answers386
viewsA: Pass jquery value to php
Good from what I understand is a simple check, you want to receive the IP and if it matches the desired, do something or not. Method Attr of J-query makes changes to tag properties and val changes…
-
3
votes2
answers52
viewsA: Search only form fields with value other than 0 and put in PHP variable
<?php cabeçalho... foreach($_POST['form'] as $value){ $table .= ($value) ? '<tr><td>'.$value.'</td></tr>'; : ''; } footer... If there are changes in the amount of items,…
-
1
votes1
answer92
viewsA: Flexbox: Is it possible to control the amount of items aligned with "space-between"?
Unfortunately there is no way, the only solution (keeping the flexbox), is to add one container every 2 div s daughters same... .pai{ width:280px; display:flex; justify-content:space-between;…
-
3
votes1
answer94
viewsA: How to create 90° "edges" in the div
Using Before and After div { position: relative; width: 100px; height: 100px; margin: 20px; } div:before { display: block; content: ""; width: 20px; height: 20px; position: absolute; top: -10px;…
-
1
votes2
answers42
viewsA: Doubt in <option> of <select>
Thus <?php if(isset($_SESSION['teste'])) : ?> <option value="<?= $_SESSION['teste'] ?>"> teste </option> <?php endif; ?> But if you’re using sessions only to pass…
-
3
votes1
answer34
viewsA: How to link the Id’s of two API’s to ANGULAR?
Just go through one of the two arrays, and make the comparison, I will demonstrate in javascript but in angular you will only add the $scope var dados = [ {id: 1, nome: 'teste'}, {id: 2, nome:…
-
0
votes2
answers1958
viewsA: Fire Jquery function when button is clicked
Your button is submitting the form, you have two alternatives, unsubscribe, change the button type. Unsubscribe $(document).ready(function(){ $("#ev").submit(function(ev){ ev.preventDefault();…
-
1
votes1
answer609
viewsA: How to get HTML from another page
Just make a request Ajax for the page, example... $.ajax({ url: 'dominio.html', type: 'GET', success: function(html) { var html= $(html.responseText); } }); The above example uses J-query, with…
-
2
votes2
answers167
viewsA: Tags < ? and ? > interpreted as html commentary
Enable the short_open_tag in php.ini Search for "short_open_tag", find the line and change the configuration value.
-
3
votes1
answer1278
viewsA: Angular application does not load in browser
By activating the html5Mode, you will need to define a base, example... Your main page is index.html then just below <header> you will add the following <base href="/nomeDoDiretorio/" />…
-
1
votes2
answers193
viewsQ: How to delete both duplicate values from the array?
I get two arrays However, when merging them, the same values must be removed: in array_unique( array_merge($array1, $array2) ) It is possible to remove duplicates, but I want to remove both…
-
0
votes1
answer520
viewsA: How to run an Angular application with Node.JS and Express
I usually pull like this server.js pastureDoProjeto index.html var express = require('express'); var bodyParser = require('body-parser'); var app = express(); app.use(express.static(__dirname +…
-
3
votes1
answer435
viewsQ: How to implement a javascript undo and redo system?
I see in some native tools on javascript, the option to redo and undo, as if it were a Ctrl + z and Ctrl + y, but they are graphical tools and not forms. I thought of something like... The…
-
3
votes1
answer40
viewsA: Open page with active form
Add autofocus in the input tag you want to do this, example <input name="campo1" type="text" class="form-control" autofocus>
-
1
votes2
answers795
viewsA: What is the best way to implement a loading bar?
Just complementing the great response of Luiz Vieira How best to implement it? There are various forms and libraries to do this, but for that create a snowball into something trivial? I used a very…
-
2
votes2
answers1483
viewsA: Mandatory field message with jQuery
I don’t have a lot of time but use that logic Method insertAfter, will display the message next to the empty input, the message is customizable, just add another class or id to it and manipulate in…
-
1
votes3
answers892
viewsA: I can’t get one div stuck on the other
Elements inline-block by default have spaces, this is some kind convention, do not know for sure, to remove these spaces just set a margin negative, example nav a { display: inline-block; padding:…
-
1
votes1
answer318
viewsA: How to create editable form using "Popover"
Missing you add two more dependencies: boostrap css and the xeditable css, also removed the form, for the api does all the work dynamically. var app = angular.module("app", ["xeditable"])…
angularjsanswered Felipe Duarte 6,284 -
1
votes1
answer814
viewsA: How to change the default "Select file" label for input file?
As far as I know, it is not possible to edit it, but there are some alternatives example... Substitute for label. input[type="file"] { display: none; } .btnPerson { padding: 10px; line-height: 50px;…
htmlanswered Felipe Duarte 6,284 -
1
votes2
answers323
viewsA: Execute document and send variable value in PHP by Ajax
Your php variable will have to be stored in client, so that in the submission of the form, the value of the name be its name in php, example... <form name="formEnv" id="env" method="post">…
-
0
votes1
answer51
viewsA: Form effect (CSS)
This effect is usually modularized frameworks, and also a pattern specified in the famous article Material Design In angular you can get them in session of inputs from the angular material inputs in…
-
8
votes2
answers795
viewsQ: What is the best way to implement a loading bar?
I have a project SPA that in each screen transition, a loading-bar (progress bar) to improve the user experience (this UX will encompass more interactivity than performance). But when researching,…