Posts by ElvisP • 1,523 points
168 posts
-
0
votes1
answer28
viewsQ: stdClass Object
What does oasterisco mean in [*data], when I convert an object to array? What’s different about it compared to array[data] ? Array ( [0] => Source\Models\User Object (…
-
0
votes0
answers24
viewsQ: Cross-origin locked in Xmlhttprequest
My javascript function is on https://subdominio.site.com.br/ tries to reach a file .JSON via GET in the main domain https://www.site.com.br/ and the return is the error in the browser console.…
-
0
votes1
answer19
viewsA: List and count results that repeat within an array
I don’t know if the question as I understand it is the answer as you hope, what I did based on understanding was: Thus: SELECT *,COUNT(tipo) AS Qtd FROM pessoas WHERE FIND_IN_SET ("teste", nome)…
-
1
votes1
answer44
viewsA: How do you get this carousel to go vertically?
$(".owl-carousel").owlCarousel({ loop: true, autoplay: true, items: 1, nav: true, autoplayHoverPause: true, animateOut: 'slideOutUp', animateIn: 'slideInUp' }); Testing on the Codepen:…
-
0
votes1
answer48
viewsQ: Cloning modified element with jQuery
In a reference HTML table, the tag <tfoot> is accessed and has its data modified [not included here because it is working], and when using the method .clone() jQuery to create a deep copy for…
-
0
votes1
answer20
viewsA: Error 1215 with foreign key
I was able to circumvent the error by changing the migrate Locations instructions to: public function up() { Schema::create('locations', function (Blueprint $table) { $table->bigIncrements('id');…
-
-1
votes1
answer20
viewsQ: Error 1215 with foreign key
I am working my first relationship of one to one tables in Laravel for countries and locations, created the models and migrate them to the two tables. Country table: public function up() {…
-
1
votes1
answer109
viewsA: How to disable all options to turn off Windows at a certain time? (hardening)
Open the regedit (Window+R) and walk the path: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\Start\HideShutDown Open the key "value" and change its value to 1. Your Disconnect…
-
0
votes1
answer220
viewsQ: Mysql LIKE condition in PHP PDO
I was used to using the condition LIKE passing the parameter in connection with the MySQL and PHP via MySQLi, and I started using PDO and no result is selected when passing the value to the…
-
-1
votes1
answer91
viewsQ: Import module after function . load() from jQuery
Because it is not possible to import a module after loading an external content by jQuery.load(), from what I understand it needs to be outside the scope, but outside the scope the content of the…
-
-1
votes2
answers464
viewsA: How to make a GIT repository a common system folder again?
git restore --source=HEAD --staged --worktree -- aDirectory # or, shorter git restore -s@ -SW -- aDirectory With Git 2.23 (August 2019), you have the new command "git Restore" This would replace the…
-
0
votes1
answer19
viewsA: Print empty query
Use the line counter of your query result and store in a variable: $count_row = $stmt->rowCount(); Then you can use the result of the variable that contains the amount of records of your select.…
-
0
votes3
answers48
viewsA: How can I put this image next to the buttons?
* { padding: 0; margin: 0; font-family: Arial, Helvetica, sans-serif; } .menu { display: flex; width: 100%; padding: 22px; …
-
0
votes1
answer46
viewsA: I can’t make the page search box work
Assuming from what I understand, you want to add the value inserted in the text field and add it to the list if it doesn’t exist, and if it does, it does nothing. function executar( ) { var texto =…
-
1
votes2
answers195
viewsA: Manipulating CSS Property with Javascript
On the W3C website there is a brief reference to HTML DOM Style width Property, you give an example like this: document.getElementById("myBtn").style.width = "300px"; Insert a ID to the target…
-
0
votes1
answer64
viewsA: How to select all options from a select to submit?
Assuming that your select has the attribute multiple defined. Instead of: $("#PedidoSelecionado option").each(function(){ $(this).attr("selected",true); }); Use: $('#PedidoSelecionado…
-
-1
votes1
answer132
viewsQ: Remote image received by CURL and reduced in PHP
The code below theoretically would be to reduce the width and height of the images [JPG FORMAT ONLY] received by CURL and store on the server, but the image created is only an image in the 800x600…
-
6
votes3
answers167
viewsQ: Why when rounding the sum of two numbers, the result is Nan?
Why when rounding the sum of the two values below returns NaN? numero1 = '1,10'; numero1 = parseFloat(numero1.replace(/[^0-9,]*/g, '').replace(',', '.')).toFixed(2); // output: 1.10 numero2 =…
javascriptasked ElvisP 1,523 -
1
votes1
answer581
viewsQ: Input with monetary mask jQuery Mask plugin from Igor Escobar
I implemented the jQuery plugin for masks in form fields developed by Igor Escobar, it is working correctly, but it occurs that when entering numerical values from 1 to 99 take the focus of the…
-
-1
votes1
answer1088
viewsQ: Truncated data in Mysql
A database table has 5 columns. 1ª id autoincremento [INT[11] NOT NULL] 2ª código do produto [varchar(15) NULL] 3ª nome do produto [varchar[80] NULL] 4ª custo do produto [double[10,2] NULL] 5ª…
-
0
votes1
answer58
viewsQ: Identify the selected INPUT array key
In an HTML form I created a field input[type='text'] with the attribute name='input[][nome]' and this field is created in the DOM dynamically on demand of the user, if the user create 3 new inputs…
-
0
votes1
answer474
viewsQ: Display numeric keypad when an input receives focus on mobile version
I’m developing a web interface with HTML5, CSS3 and the framework Bootstrap 3, and using the type="number" on the tag <input> on smartphones the native keyboard of Android open in numeric…
-
0
votes3
answers86
viewsA: Receive data from external Json and display its contents in loop as array using PHP
With the help of @Diego Martins' reply I was able to solve the problem by checking the error that prevented the conversion of JSON string to objects as associative matrices and below follows the…
-
0
votes3
answers86
viewsQ: Receive data from external Json and display its contents in loop as array using PHP
The external url has a data structure that I receive in my code and it is being received as a string JSON, I tried to decode it but I didn’t get any results.…
-
-1
votes1
answer20
viewsQ: Change Array Structure in PHP
I get an Array that has the structure below, and I would like to clean it by changing the values of the ex keys: [19741N], which are random values by increasing numerical values 0 =>…
-
2
votes3
answers651
viewsQ: Treat Json return array with CURL
The code below returns real estate code results from a Rest API, and it comes with array within array, expected to treat the list to get only a Code array with its value, e.g.: <?php $dados =…
-
0
votes1
answer279
viewsQ: INSERT with clause SELECT WHERE NOT EXISTS
I found in the Sopt a response to the same case that mine, but something unexpected happens because this is new to me, the SQL statement below returns an error while running. $sql = " INSERT INTO…
-
1
votes1
answer34
viewsA: Background css does not work
Try the cross browser CSS code, create the CSS code here: .bg{ background: rgba(233,30,98,1); background: -moz-linear-gradient(left, rgba(233,30,98,1) 0%, rgba(63,81,181,1) 100%); background:…
-
1
votes1
answer76
viewsA: Insert td into tr using jquery
Confers http://api.jquery.com/append/ A generic example: $("table tr").append("<td>COLUNA_02</td>"); table tr td{ background-color:#ccc; } <script…
-
-2
votes1
answer62
viewsQ: List alphabetically ordered Mysql records in PHP
I created a table to store records of names of people where the field a_tipo store the alphabet letter related to the name, the table structure is like this: With PHP I made the connection to the…
-
4
votes1
answer545
viewsA: Image in Json without using Base 64
Suppose your file that will display the image is anywhere, either remote or localhost, and suppose inside the file directory you have a subdirectory called "images". The structure of Json will be: […
-
0
votes1
answer57
viewsQ: .error() in jQuery is not a funciton
I inserted after loading all the content of my website the function below, and is returning an error message on the console. Typeerror: $(...). error is not a Function I tried to fix it using the…
-
1
votes2
answers83
viewsQ: Remove an attribute from the <a> element when there is a specific attribute - jQuery
In the HTML of the page I’m adjusting, it contains several links with a function in the onClick: <a href='#' onClick='funcao(100)'>Link</a> and the current Javascript is like this:…
-
1
votes1
answer161
viewsA: How to limit a div draggable from overtaking the corner of the screen?
Use the "containment option": jQuery UI API - Draggable Widget - containment The documentation says it only accepts the values: 'Parent', 'Document', 'window', [X1, Y1, x2, Y2], but I seem to…
-
1
votes1
answer34
viewsQ: Elements inserted via . html() and jQuery key action
The idea of the code is to search for products and insert the product link when the user selects the registration link as a linked product. By clicking on input[type='radio'], a new field is…
-
0
votes2
answers803
viewsQ: Mysql query with LIKE
I made the query below to return all records containing the word 'Juscelino' in the user table, the word 'Juscelino' repeats 3 times, the query searches in 3 different fields, which is not required…
-
0
votes0
answers132
viewsQ: Form with mandatory input sends empty POST - Bootstrap
The form within a modal is sending the POST even with the required input but not completed. The modal is inside a separate file from the page and is included by PHP include(). When executing the…
twitter-bootstrapasked ElvisP 1,523 -
1
votes1
answer50
viewsA: How to check if a session exists
If you want to validate if the session does not exist, and prevent page loading by the user, you need to do the reverse logic: If the session does not exist. <?php // Verifica se a sessão da aba…
-
3
votes2
answers128
viewsA: Button does not show full name
I left some examples on the use of width in CSS, check the behavior of them outside of your layout, in the case below I did not hide the contents leaked (the title), and rather broke line, but in…
-
0
votes3
answers49
viewsA: Send form to database with Mysql and php
Messages are notifications that your variables have not been declared previously, this is not an error but notification, you can disable them by setting display_errors as 0 or use the function…
-
0
votes1
answer34
viewsA: Mysql - CASE WHEN, the third condition does not return the THEN
I entered on condition that the date is also different from "000-00-00 00:00:00" and if it is not < or > then it is an undefined date, then I entered the ELSE 'Pending', I do not know if it is…
-
1
votes1
answer34
viewsQ: Mysql - CASE WHEN, the third condition does not return the THEN
I made the QUERY a CASE to display in 'Data' output if current, expired or pending, but for pending has no output when printa. $sql_check_plano = "SELECT *, ( SELECT `ps_nome` FROM `plano_pack`…
-
0
votes1
answer49
viewsA: Clicking on the page always calls the first div
Alters: <li <?php echo $estilo; ?> ><a href="?pagina=<?php echo $i; ?>"><?php echo $i+1; ?></a></li> To: <li <?php echo $estilo; ?> ><a…
-
2
votes2
answers112
viewsA: Change value according to the input typed using Ajax without clicking a button
$(document).ready(function(){ $('input.input').keyup(function() { $('div.showDiv').html($(this).val()); }) }) input,div { padding: 6px; display:block } <script…
-
1
votes1
answer25
viewsA: Create a javascript function for all application buttons
var buttons = document.getElementsByTagName("button"); var buttonsCount = buttons.length; for (var i = 0; i < buttonsCount; i += 1) { buttons[i].onclick = function(e) { alert(this.id); // O que…
-
0
votes2
answers49
viewsA: Multiple delimiters in PHP gives error, Phpmyadmin does not
I solved the problem with the help of the top response made by @Bins, with some changes due to error messages with "Strict Standards" that the partner’s solution presented, follows the solution in…
-
1
votes2
answers49
viewsQ: Multiple delimiters in PHP gives error, Phpmyadmin does not
I created a QUERY with multiple delimiters to run only once and perform UPDATE in different tables, but gives syntax error when run in PHP, but in Phpmyadmin works normally. I already checked the…
-
2
votes2
answers432
viewsQ: Select from multiple tables with the same ID in Mysql
The intention of the query is to select all records of various tables when the ID is equal to the one passed in the parameter, echo of the SQL line displays the query below, the records exist, but…
-
0
votes1
answer65
viewsA: SELECT CASE WHEN DATEDIFF considering hours, minutes and seconds
Resolve by changing DATEDIFF to TIMEDIFF according to the references on the Mysql website. $sql_plano = "SELECT *, ( SELECT `nome` FROM `plano_pacote` WHERE `token` = `ps_token` LIMIT 1 ) AS…
-
1
votes1
answer65
viewsQ: SELECT CASE WHEN DATEDIFF considering hours, minutes and seconds
I created the query so that when a plan expires, the output 'Date' will print 'Expired' and if it has not yet expired, print 'Current', but I need to take into account also the time(s), minute(s)…