Posts by Pedro Henrique • 917 points
52 posts
-
1
votes1
answer173
viewsA: Convert JSON to Array Upload via Curl
In your code there is a problem, you are trying to define an object value for a key within the array directly, this is the reason for your error, in this line: $jsonData = array("amount" => 500,…
-
0
votes1
answer52
viewsA: Format string to print square root, exponent
It is possible to use some plugins, one of which I like to use would be the Mathjax, would just read the documentation and see how each expression needs to be called to generate an equation.…
-
1
votes1
answer194
viewsA: Problems defining sizes in flexbox items
I redid the structure html and css, continued using flexbox as informed. Upshot: https://imgur.com/fX9AzyL HTML <div class="container"> <div class="titulo-situacao"> <div…
-
1
votes1
answer151
viewsA: How to create a button with Javascript, which when clicking it advances to the next section?
It is possible to do using a counter sectionAtual, in this case before performing any event, I counted how many section exist in the DOM, with this I made an event click on the arrow, in that event…
-
3
votes1
answer44
viewsA: CSS of different Ids for the same Classes
You can do this by manipulating the element selector, in case I used ^= that will select all the elements that begins with classe-, ie, will assign the property background-color for the elements p…
-
0
votes1
answer689
viewsA: Remove accent and special characters from a pdf file name
You can use an change in the file selection element, when some file is selected, the name of that file will be recovered and shown on the screen to the user. // Evento ao selecionar um arquivo…
-
1
votes1
answer69
viewsA: Display JS variable in HTML
In your case just use the innerHTML to display the score. Simply retrieve the score and assign it to the element with the id=contarPontos. function contarPontos() { if (!localStorage.pontos) {…
-
1
votes1
answer340
viewsA: How to leave the image on the left and the text on the side
To align the image, you need to leave the element IMG and the element DIVat the same level, after that just use the display:flex normal, I used the justify-content: flex-start to force the start.…
-
0
votes1
answer391
viewsA: Update select after registration without refresh
I recommend splitting your code into two files, one that will contain all the information on the page and a second that will be a jquery helper to perform a new query, which will contain only the…
-
0
votes1
answer373
viewsA: Percentage calculator in Javascript
What happens is that you are working with string and not with a real number, to work with decimal number that contains comma you need to turn it to decimal in the standard computational format that…
-
0
votes1
answer35
viewsA: Doubt: How to insert multiple lines using $_GET and Mysqli from the same.php file to the same table
Let’s make a small change in your HTML to be better to control how many records there are to perform data insertion in the table. In the name Torete Length select will be of best use, vector…
-
1
votes1
answer180
viewsA: Inner Join Laravel
When using the first(), you recover the first line of your query SQL, ideal for queries that will return only one result. When using the get(), you recover all the query lines. (Remember that you…
-
0
votes1
answer32
viewsA: Simulate mysql Join with a php array
Can be done using the foreach (not necessarily, can use other ties). In my case I used the most propitious logic that came to mind, create a new array with the new information. For this I created a…
-
0
votes1
answer35
viewsA: How do I center a page loaded by onclick into a div?
I needed to make some changes to your css, there are some things to be adjusted, as I do not know if you will use this form formatting file on other pages, I took it for me to keep the structure. I…
-
0
votes1
answer207
viewsA: Help, generate graphics with json
First of all it is necessary to remember some things. We have to remember that the JS is synchronous, that is, he does not expect your consultation ajax for after generating the graph, it will do it…
javascriptanswered Pedro Henrique 917 -
0
votes2
answers34
viewsA: Jquery by selecting three forms at once
What is probably happening, when submitting any form is called the function $('form').submit(), for it was passed $('form'), to fix this problem, just in place of form, any pass ID or CLASS, so…
-
0
votes2
answers64
viewsA: Clear only a part of the URL
It is possible using the split, you can separate your url by & and retrieve only the first parameter. let url = "google.com?id=1&msg=sc"; // url let urlSplit = url.split("&"); // cria um…
javascriptanswered Pedro Henrique 917 -
1
votes1
answer325
viewsA: Ignore accent when using search menu (input)
It is possible to create a function for this particular case, which would remove the accents only in the query, in the example below I entered a function called removeAcento that will receive a…
-
-1
votes2
answers58
viewsA: Error in logic, icon does not change when I click the submenu
Since the HTML code was not inserted, I made my own html and implemented a logic of how to fix the problem, follow the code below. $(".button-menu .menu-item-arrow").click(function() { // evento ao…
-
0
votes1
answer35
viewsA: Display image only on those with database data and display name when mouse over image
Before creating the column, perform a check if the database information exists any file. To simplify, the ternary operator was used to carry out the verification. <?php echo " <tr>…
-
1
votes1
answer237
viewsA: Multiply two numbers and show result (JQUERY/JAVASCRIPT + PHP)
This happens because the return of the variable otherincome is an object and is trying to accomplish a sum with an object, you must set a value to the input[id="valor_tabela"] and then reclaim its…
-
0
votes1
answer46
viewsA: Is it possible to loop with "0" on the left in PHP?
Try to change the logic, make a loop from 1 to 1000 (as is already being done, without the str_pad) and in your echo the text is formatted. <?php for($x = 1; $x < 1000; ++$x) { echo "O X é:…
-
1
votes2
answers424
viewsA: Style Bootstrap 4 select combo box
It is possible to make this change styling the element itself, in the example below I used a class=selectCustom and made all my changes to that class. In its file calls, the styling file should be…
-
2
votes3
answers108
viewsA: Javascript input check
It is possible to use the function submit of our jquery friend, when sending the form , a check is made on function call. What was done in the code below, was to check if at least one image was…
-
0
votes3
answers115
viewsA: Conditional structure if Else are not working
The error is in all conditions and function call, because instead of comparing one value with another you are assigning the value to it, already in your function calls, no parameter is being passed…
javascriptanswered Pedro Henrique 917 -
0
votes2
answers516
viewsA: Can I run a Reactive Native app on Iphone through Windows?
To rotate the command react-native run-ios Xcode tool that only works on OSX is required. Nowadays it already has solutions(gambiarras), however, they are not very well seen, because they are slow.…
-
0
votes2
answers50
viewsA: HTML and CSS contact selection
Can be done with jquery, using the function change to recognise a change in the element, slideDown to display the element and slideUp to hide. $('input:radio[name="radio"]').change(function() {…
-
0
votes4
answers87
viewsA: Show/Hide Information by clicking
Taking @Lucas Ayrosa’s response as the basis, I refactored and simplified the code. You can use the attribute data-element and carry out toggle in both elements.…
-
3
votes2
answers185
viewsA: Javascript function is only triggered after 2nd button click
This is because by clicking the first time you call the function removerEstado() and calls the click function, in the second the function has already been called and the click function can be used.…
-
0
votes2
answers152
viewsA: Way not to break a line when creating an input element
A width for your input. main{ width: 100% } input:text{ width: 50%; } <main> <input type="text"> <input type="text"> </main> Another method would be using flexbox.…
-
0
votes1
answer270
viewsA: Do operations with a JS calculator display data
I made some changes to your code, first at the beginning of the code, declared a variable called operador, this variable will save what will be the operator of this calculation, with it declared in…
javascriptanswered Pedro Henrique 917 -
1
votes3
answers131
viewsA: Problem when trying to add elements ckeditor
I’ve had a similar problem before and I believe it will be good for you too. This can happen when the Ckeditor dialog box is triggered within an active modal. Solution Inside the folder of your…
-
1
votes1
answer51
viewsA: Disable disabled from form
You can create an auxiliary function that will recover the data from the disabled inputs and thus not needing to disable any field as the function serialize() does not recover these data, follow the…
-
2
votes1
answer217
viewsA: Get data inside stdClass with several stdClass inside each other in PHP
Suppose I received a return in this object format, to access the information of this object, I do not need to transform it into an array, I can access it directly, follows the example below. Return…
-
0
votes2
answers61
viewsA: How do I check the internal contents of an array?
You can use the method filter(), in which case it will go through the array and delete the positive numbers, the ones that will remain in the array are only the negative or zeroed. const array =…
-
0
votes1
answer26
viewsA: Problem with scroll horizontal ckeditor
There may be some file css attributing overflow=hidden for that element. As not much information was added, I will use an attribute of Ckeditor itself to apply a style to that element. Inside the…
-
0
votes2
answers304
viewsA: How to get components beyond the standards in Fullcalendar?
I don’t know much about the structure of your code, but the way I use works just right this function you want to implement. let allEvents = []; // Variável onde ficarão todos os eventos. // Esse…
-
1
votes2
answers45
viewsA: Javascript: Array usage problem coming from php
Apparently everything is right with your code, what I can notice will be just a parameter that you should pass different, follows the code snippet. requisicao.open("get",…
-
0
votes1
answer209
viewsA: How to pass the value of 2 Select Option by Javascript
You can declare two variables, a variable containing the value of auto and another variable containing the value of conta, with these two variables only include as a parameter of your URL. I used…
-
0
votes1
answer449
viewsA: Countdown with Javascript
I made a similar application in my project to put the page in maintenance in case it is necessary to perform some maintenance. For the code to work properly it takes two things: initial and final…
-
1
votes2
answers184
viewsA: Discover time interval
In PHP there is a function that makes the calculation of this time difference, you need to inform the date as DateTime and use the function diff to carry out the operation, follows the documentation…
-
0
votes1
answer37
viewsA: Search data in BD when loading page
For you to make this query, you can do via GET that for this form of query is one of the most used. First you need to determine an ID for each category, so each link will have a href for php list.…
-
0
votes1
answer31
viewsA: Error message if e-mail already exists in the database
As you use the bootstrap you can use some very interesting classes, I will give an example of one of them that I use and I find very interesting. Follows the documentation of the classes…
-
1
votes1
answer593
viewsA: Update field with select data
You can do this with ajax, I’ll show you a very practical and simple example to understand. I created a select with drivers, in options I put the driver id and an input to receive the phone,…
-
1
votes2
answers34
viewsA: Arrangement of grid boxes
Try using your css this way, follow the link from documentation flexbox. .flex-container { padding: 0; margin: 0; list-style: none; display: flex; -webkit-flex-flow: row wrap; justify-content:…
css3answered Pedro Henrique 917 -
0
votes1
answer26
viewsA: Laravel Sqlite migrate error
In both methods you are trying to create the id column twice, one at the beginning and one at the end, two columns with the same name are not allowed in a table. Try to perform the execution this…
-
0
votes2
answers83
viewsA: Remove an attribute from the <a> element when there is a specific attribute - jQuery
You can use the function attr, as follows: documentation The removeAttr, has some problems to run on some browsers, to avoid light complications as usual use the function attr or prop for those…
-
0
votes1
answer70
viewsA: Set PHP constant with INI file value
Good afternoon, There is a way to open the file and read what is inside it, in PHP there is the function parse_ini_file which allows you to read the data of an INI file and return an array with the…
phpanswered Pedro Henrique 917 -
0
votes3
answers32
viewsA: Concatenation in function checks
Use something like, use this way of concatenating. $linkBloquear = "<a href='?produtos&bloquear&idProdutos=123' onclick='return verifica(\"{$mensagemBloquear}\");'>Teste</a>";…
-
0
votes1
answer249
viewsA: Problem with AJAX, PHP, Mysql select dependents
Good afternoon, I found a problem and I will pass on what and how I managed to solve and rewrite with my taste to concatenate. In return in ajax.php, change the first line to <?, for <?php ,…