Posts by fernandoandrade • 1,070 points
55 posts
-
2
votes1
answer34
viewsA: DIV does not respect dimension after mouse-over
Removes the *:hover of your css, this changes all elements of the page hover, in the case of div is that it leaves the margin at 0 in all directions, no longer centralized from when it was with the…
-
1
votes1
answer1190
viewsA: Placing an image with in a React component
Your import returns a variable, do not need to use the " <img src={logo} alt="Alguma coisa"/>
-
1
votes1
answer66
viewsA: Links inside the page do not open or work
The fault is this js code on your page: $(function() { $('a').on('click', function() { return false; }); });
-
0
votes1
answer158
viewsA: How to take the value of several select in the same change
Since you were using the class selector to pick the max value, it always takes the first one from the screen. Swap to take the value of the select being changed, using the $(this):…
-
0
votes0
answers14
viewsQ: Query wordpress access control via mysql
I am migrating a wordpress site and need to consult the access control to the posts to add them to the new CMS, the site uses the plugin User Access Manager to control access to posts. I have to do…
-
0
votes2
answers1441
viewsA: Change color of a table row according to the value of td with jquery
If the status information is not changing you can put it right in the same class: <tr class="status status-<?php echo $linha['status'];?>"> There in css you make the rules for each…
jqueryanswered fernandoandrade 1,070 -
0
votes2
answers42
viewsA: How to get variable js from sucess pro php
You can try doing it right in php // Pegue o valor via URL $json = file_get_contents('sigilo.com.br/ip'); // Transforme o resultado em um objeto JSON $obj = json_decode($json); // Ou transforme o…
-
1
votes1
answer21
viewsA: Count how many Databases there are
Try to do so: SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'nomeDoBanco' and TABLE_NAME like '%pedidos%';
-
0
votes2
answers867
viewsA: How can I echo a JSON in PHP?
The return view as an array of objects, as you give json_decode($result, true); it becomes an array of array. Just do so: echo $final[0]['price_usd'];
-
0
votes2
answers289
viewsA: Xampp - Does Not Start
Just rename the file index.php which is in the folder htdocs, that there will list your projects
-
1
votes3
answers1217
viewsA: Float half of the Dropdown Menu list to another position
I did something similar, this already, only that determined the direction of the menu according to the screen size, the code was more or less like in the example, the menu was not with bootstrap and…
-
1
votes1
answer152
viewsA: Run javascript function if condition is true
Following @Andersoncarloswoss' suggestion makes similar: $('#sa-success').click(function () { if (teste !== true) { return; } swal({ title: 'Good job!', text: 'Lorem ipsum dolor sit amet,…
javascriptanswered fernandoandrade 1,070 -
0
votes1
answer87
viewsA: Mobile Phone Repair x Desktop
You defined the width for some elements of the page and for those with the "bar" not. And also the images that are being shown in full size. Just do it like this: #paisapro, .linha1, .linha2,…
-
0
votes1
answer351
viewsQ: Select elements by holding and dragging the mouse
You can select elements on the screen as in the image example: I have elements and want to select holding and dragging the mouse, as we do in the OS file manager. I can already select several with…
-
0
votes1
answer398
viewsA: Send more variable "serialized" form via AJAX?
You can do it like this: var ID = 100; function register() { var data = $('#form').serializeArray(); data.push({name: "id", value: ID}); $.ajax({ type: 'POST', url: 'meu_script.php', data:…
-
1
votes1
answer1119
viewsA: navbar-Fixed-top bootstrap occupying every browser
Adds the following css: .navbar-fixed-top { right: auto; } The navbar-fixed use the rules left: 0 and right: 0, causing the element to occupy the entire page, just change to the value auto. And move…
-
2
votes1
answer40
viewsA: How to upload images and display them using jquery?
Try to do it this way: var imagesPreview = function(input, placeToInsertImagePreview) { if (input.files) { var filesAmount = input.files.length; $(placeToInsertImagePreview).empty(); // remove as…
-
0
votes1
answer42
viewsA: Sum optin: how to do?
Just do it like this: $('select').change(function(event) { var valor = $(this).val(); // verifica se o valor é um número if (isNaN(valor)) { return false; } var totalAtual =…
-
0
votes2
answers431
viewsA: Sender’s email is the default email in the form
It would be something like that: <form action="enviar.php" method="post" > <label for="ipt-nome">Nome:</label> <input type="text" name="nome" id="ipt-nome"> <label…
-
3
votes1
answer110
viewsA: Pass files by ajax
First check if your form has the attribute enctype="multipart/form-data" which allows you to upload files, then change your code to something like: var fData = new FormData($('#formProduto')[0]);…
-
1
votes2
answers172
viewsA: problem with data validation preg_match
Try to do it this way: $string = 'palavra com espaço 123'; if (preg_match("/[\sa-zA-Z0-9]+?$/i", $string)) { echo '<pre>'; print_r($string); echo '</pre>'; } Adding a \s which matches…
-
0
votes1
answer254
viewsA: Remove group of Divs "Clones" in jquery
Try to do it this way: <script> $(document).ready(function() { $("#duplicar").click(function() { // coloca um id e uma classe para cada div copiada var id = +(new Date()); $clone =…
-
0
votes0
answers73
viewsQ: Error when using imagejpeg function in internal PHP class function
I made a class to generate images: class Thumbnail { private static $allowedTypes = [IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP]; private $JPEGQuality = 75; public function…
phpasked fernandoandrade 1,070 -
0
votes1
answer199
viewsA: How to configure Ajax to submit date with 2 variables
Try to do so: if (isset($_GET['id']) && isset($_GET['value'])) { $dados = []; $dados[codigo] = $_GET['id']; $dados[valor] = $_GET['value']; echo json_encode($dados); } Play the values in an…
-
1
votes2
answers41
viewsA: Javascript Json
It would be something like that: a = ["a: 0", "b: 1", "c: 0", "d: 0"]; obj = {}; obj['y'] = '2017-8'; a.forEach(function(el, i){ var arr = el.split(': '); obj[arr[0]] = arr[1]; }); console.log(obj);…
javascriptanswered fernandoandrade 1,070 -
1
votes0
answers528
viewsQ: Consult ZIP code by user location
There is some way to query the ZIP code from the user’s location, provided by the browser. Type given latitude and longitude return ZIP of past coordinates. It would be something like: function…
javascriptasked fernandoandrade 1,070 -
1
votes0
answers1124
viewsQ: Composer error 'File or directory not found'
installed the following Composer website instructions, passing the directory /usr/local/bin and file name composer. But when I do: $ composer install or another Composer command returns the error:…
-
2
votes1
answer394
viewsA: How to overlap a div in the footer of another div
Just you set the bottom of the div who will be on top, and puts the father div with position relative. .publi{ max-width: 230px; max-height: 300px; overflow: hidden; position: relative; } .limt-img{…
-
2
votes2
answers2069
viewsA: Cut image inside a CSS div
You can use background-image along with background-size to adjust the image Changing the scale of background images…
-
1
votes1
answer276
viewsA: Accept string with letters, numbers or dots
Add a method to Validator $.validator.addMethod("validarUsuario", function(value, element) { return this.optional( element ) || /^[a-zA-Z0-9.]+$/.test( value ); }, 'Informe um usuário válido.');…
-
1
votes1
answer112
viewsA: Add Textbox’s results from one page to another HTML page table
You can leave it on the same page as adding the values in the table when the user clicks the Finish button. Simple example: jQuery(document).ready(function($) { var $table = $("#myTable2 tbody");…
-
7
votes2
answers3644
viewsA: verify registered user PHP Mysqli
Just check if there is already any user with the past email $result = $mysqli->query("SELECT COUNT(*) FROM usuarios WHERE email = '{$email}'"); $row = $result->fetch_row(); if ($row[0] > 0)…
-
0
votes1
answer88
viewsA: Preload with Cookie or Session
You can set a variable in $_SESSION and check if it was set at the time of showing the Preload, in the case of PHP would be something like this: <?php session_start(); if…
-
0
votes1
answer98
viewsA: Take the data inside the div and then print it in pdf (any method)?
For the pdf you can use FPDF is a good solution to generate pdf files, to send the data, you place your form to submit to a page that will receive the data and generate the pdf…
-
0
votes2
answers1383
viewsA: jquery, onclick catch id values <a
Try to do it this way: $(document).ready(function() { $('.link-data').click(function(e) { e.preventDefault(); var idn = $(this).children('input').val(); $.ajax({ type:"POST", url:"upd.php", data: {…
-
1
votes1
answer45
viewsA: Search in the database when loading the page
You can do this in many ways, it will depend on what your page looks like. For example, you can simply query the top of the page before rendering any HTML and check the condition, if it is true when…
-
2
votes1
answer68
viewsA: Reverse animation when taking mouse
You can use Transition to change the height of the widget in the Hover sort of like this: .our-works { z-index: 1; } .item-works { z-index: 99999; display: block; float: left; width: 24%; height:…
-
2
votes1
answer600
viewsA: perform a checkbox validation per row of a table
Better to do it dynamically, if you have to check more lines you will have to change the code every time you add a new one. $(document).ready(function() { $('#check').click(function(event) {…
-
1
votes1
answer6249
viewsQ: Insert caption footnote in Latex
How do I insert a footnote into a figure’s caption? With the code: \begin{figure}[htb] \centering \begin{subfigure}[b]{.4\textwidth} \centering \includegraphics[width=\textwidth]{imagens/gui/atom}…
latexasked fernandoandrade 1,070 -
0
votes3
answers638
viewsA: How to open a new page by clicking on the table row?
Try to do it this way: $("#tabela-estacoes td").click(function() { var identifier = $(this).parent("tr").attr('identifier'); var $form = $("<form></form>"); $form.attr({ action:…
-
1
votes1
answer603
viewsA: load ajax combo when opening page
It would be something like this, could open a modal or another form for the user informs the new value and when saving reload the select. $('#btn_adicionar').click(function(event) {…
-
1
votes2
answers277
viewsA: Return Multiple values with PHP jQuery
Play the result of the two queries in an array $query1 = "SELECT * FROM `tblpedidos_upload`..."; $query2 = "SELECT * FROM TblPedidos ..."; if (!$result1 = mysqli_query($con, $query1)) {…
-
2
votes2
answers1061
viewsA: Scroll from bottom to top
You can do so, give a scrollTop with the height of the div var divMensagens = document.getElementById('mensagens'); var height = divMensagens.scrollHeight; divMensagens.scrollTop(height);…
-
0
votes2
answers945
viewsA: Load value in input text after selecting value in select Codeigniter
I think your select should already be written in full on the page, the way it is in the code, it seems that only in the event change that the select is mounted. Follow example to find the value…
-
3
votes1
answer577
viewsA: How to communicate between java in Prolog?
An alternative is the library tuProlog I used to make a chess game using java for the interface and Prolog as inference engine In the Java file would have something like: static Prolog engine = new…
-
0
votes1
answer98
viewsA: Query $ajax "GET" showing "Undefined"
According to the image you left the link, your object has the variables in minuscule and you are trying to access posto.Ativo where the correct would be posto.ativo
-
1
votes1
answer1277
viewsA: I want to use ajax to simply update a table that reflects the database, without updating the page
In the form Submit you make an ajax to save and if positive adds the record in the table. The return can only be the value of the record or the html of the new line. Following example:…
-
3
votes3
answers391
viewsA: Insert multiple mysql checkbox records
When you do <input type="checkbox" name="f_carteira[]" what comes POST is an array and the conversion from array to string is the word Array. What you can do is give one implode to convert to a…
-
1
votes2
answers1139
viewsA: PHP - Create a checkbox list dynamically
<?php $cat = [ ['id' => 1, 'nome' => "Cat A"], ['id' => 2, 'nome' => "Cat B"], ['id' => 3, 'nome' => "Cat C"], ['id' => 4, 'nome' => "Cat D"], ]; foreach ($cat as $key…
-
2
votes2
answers1159
viewsA: Translate website automatically according to the country of the internet user
You can pick up the language using JS and from there translate your content. <script type="text/javascript"> var userLang = navigator.language || navigator.userLanguage; </script>…