Posts by rdleal • 1,109 points
30 posts
-
5
votes3
answers235
viewsA: arrays equality in Java Script
In Javascript, arrays and objects are passed by reference. That’s why you can edit array values oi through the variable xau, since both point to the same array. You can create a copy of the array oi…
-
2
votes1
answer424
viewsA: How to run event right after $('div'). load(url)?
You can use the .ajaxComplete, which will be executed whenever an ajax request completes. $( document ).ajaxComplete(function() { console.log('carregou') }); If you need to differentiate requests,…
-
1
votes1
answer60
viewsA: Problem with Array for Json
To the following lines: $rows[id]=$sonuc[id]; $rows[userid]=$sonuc[userid]; $rows[uniform_type]=$sonuc[uniform_type]; $rows[date]=$sonuc[date]; $rows[size]=$sonuc[model]; $rows[color]=$sonuc[color];…
-
1
votes1
answer83
viewsA: Change input number and sum form field values
The problem with your code is inside the each. In the callback function of the each is trying to get the result of each item to do the calculation, but when using $('.order_input_qnt').val() is…
-
2
votes1
answer109
viewsA: Registration in foreach php
The estate $this->Data seems to be a associative array. Although PHP does not distinguish between associative array and indexed array, its code does. Try to remove the foreach of the code, and…
-
1
votes2
answers98
viewsA: Help with JSON and jQuery
First the event you are using to check if a checkbox has been selected is not the most correct (click). For such action, it is best to use the change: $("input[name='estrelas']").on('change',…
-
1
votes1
answer571
viewsA: How to execute a javascript code received by an AJAX request?
If you use the document.write after the HTML page has been loaded, the browser will overwrite the current content by the content of the document.write. In your case, when you run ajax the page has…
-
2
votes2
answers193
viewsA: How to take the value of POST and save to the bank
Apparently the information you need to write is in the variable $informacao. Try replacing the following lines: $parcelaplano[''] = trim($_POST['parcelaplano']); $porcentagem[] =…
-
5
votes2
answers216
viewsA: How to show elements in sequence?
You can use the method delay jQuery object to delay the execution of the next operation, in case the fadeIn: // aumente ou diminua este valor para alterar o intervalo entre as animações. var…
-
3
votes2
answers660
viewsA: Sum dynamic line values automatically
You can separate the calculation into a function: function calc() { if($(this).val().length > 0) { var total = 0; $('.input').each(function(){ var valor = Number($(this).val()); if…
-
1
votes3
answers38537
viewsA: Alignment of buttons with css
How your buttons are with display: block-inline, their behaviour will be similar to an element inline, being subject to text alignments. Then you can add the following rule in the element body to…
-
5
votes2
answers76
viewsA: Error while running script
After the first parameter, the function scanf expects to receive a reference the variable that wants to store the input value: scanf("%d", &x); I hope I’ve helped.…
-
3
votes1
answer1437
viewsA: Transform result into array and take all values in "select"
Here are some modifications I suggest, so that your code works the way you want it to. As already mentioned, the fetch_array returns only one query line or NULL if there is nothing more to be filled…
-
1
votes3
answers349
viewsA: I need to clone the contents of a div and put in the form of my modal
The problem may be that when you try to insert cloned element content #divConsulta, the modal content has not yet been inserted in the GIFT and therefore the #formFruta is not yet available for…
-
1
votes1
answer40
viewsA: Repetitive java script message
Where are you using the .append replace with .html: $("#mensagem").addClass("alert alert-danger").html("<strong>OPS!</strong> Usuário ou Senha Inválida"); The method append adds the…
-
6
votes1
answer1023
views -
2
votes2
answers78
viewsA: Change word displayed by php
You can create a mapping of the categories, using the name of the category you want to replace as key, and the new name as value: $categories = array( "Time" => "Team Supply" ); And, when…
-
1
votes1
answer195
viewsA: Image Upload with PHP Returning an Error: Undefined index error
Your problem may be with the directive post_max_size of php.ini. According to the documentation: [...] If the posted data is larger than post_max_size then the variables superglobals $_POST and…
-
1
votes1
answer62
viewsA: How to use DNA?
Just insert the condition into the array $WHERE outside the if (!empty($data)): public function RetornaAtualizacoesFuncionarios($data,$codusuario){ $WHERE = array() ; if( !empty( $codusuario ) )…
-
0
votes1
answer421
viewsA: Get JSON values using Shell script
Only with the grep you won’t get the string in the format you need (numero - url). With the help of the tool awk gets easier: curl -s 'http://brasil.br/pub/retorno.json' | grep -Po '"(numero|url)":…
-
1
votes4
answers318
viewsA: How to return an object from a dynamic reference in Javascript?
You can use the global object to access variables global dynamically. In the browser the global object is the window (you can use the this also, which references the same global object as the window…
-
0
votes1
answer111
viewsA: How to create Array with BD content
By resemblance to code, I assume you’re using this library: http://www.devwilliam.com.br/php/crud-generico-com-php-e-pdo If applicable, just use the method: public function getSQLGeneric($sql,…
-
0
votes2
answers336
viewsA: DELETE method using href - Nodejs
When the href is used, the browser uses the method GET to request. In the module documentation method-override it is written that by default the only HTTP method it overwrites is the POST. In order…
-
3
votes1
answer547
viewsA: Can I use the same Id I set for Name in HTML?
Yes, you can use the same value for the attribute id and name in the same element without problems. It is worth remembering that the value of id should be unique for each document, the value of the…
-
0
votes2
answers154
viewsA: Transforming a data structure into javascript
You can unify the items by name into an object, and then turn them into the array of objects you need by traversing this unified object: var input = [ {id:1, idforeign:2, nome:'etc'}, {id:2,…
-
3
votes1
answer363
views -
1
votes3
answers239
viewsA: Reusability of the Control
To Controller is usually dependent on the language/technology used by View and Model, so if you change the way the two communicate with the Controller, will hinder a reuse of it. I will try to make…
-
4
votes1
answer204
viewsA: Problem sending images to a folder with accented names
Using accent on filenames is a bit tricky and will hardly be a portable solution. Operating systems handle character encoding in different ways. Linux Linux uses binary for filenames. This means…
-
8
votes2
answers221
viewsA: Use of methods in php object orientation
If you do not know the names of the categories before they are created, you can use the method __call to leave the dynamic creation. An example: class Categorias { protected $name; private $prod;…
-
2
votes2
answers124
viewsA: Form: one choice is free, two have to charge. How do I?
Add the following code after the calculation of Time: $( "div#emporio :checkbox:checked" ).each(function() { sub += $( this ).val() * $( this ).parent().children( "select" ).val(); }) //each emporio…