Posts by Rocha • 177 points
6 posts
-
1
votes1
answer88
viewsQ: Foreach List does not recognize array
I’m using PHP. I pass the values by _POST, and I have a string, which I turned into an array: By the _POST method it arrives like this: [1v4],,,,[5v3],,,[8v] Remove excess commas, pull the v…
-
1
votes1
answer29
viewsQ: Delete variable provided when unchecking Checkbox
I have a code that saves in a textarea values from a checkbox, but I cannot make the value be deleted from the textarea when the checkbox is unchecked. var checkbox =…
-
3
votes4
answers22787
viewsQ: Sum Javascript Array
var quant = document.getElementsByName("valor[]"); var teste = []; function somarValores(){ var soma = 0; for (var i=0; i<quant.length; i++){ teste[i] = quant[i].value; soma += teste[i]; }…
javascriptasked Rocha 177 -
4
votes2
answers1281
viewsA: Return JSON to PHP
I found the problem. It didn’t echo because of the accentuation. Just put the encoding as below in the file cep.ajax.php and the problem was solved! $cidade = (utf8_encode($row['cidade']));…
-
3
votes2
answers1281
viewsQ: Return JSON to PHP
I’m making a registration system, where the ZIP code search should appear as soon as the field changes. But the AJAX return is not working. How do I return JSON to PHP? PS: ZIP search is offline…
-
4
votes1
answer176
viewsQ: Pass variables with same name to PHP
I can’t catch the return of the fields in PHP, when I enter more than 01 in quantity.... someone can help me? $(function() { var input = $('<input name="cp1" id="cp1" type="text" />'); var…