Posts by Otavio Souza Rocha • 545 points
57 posts
-
0
votes3
answers1262
viewsA: Hide a div and show another
Sort of like this function toggleDiv() { if(document.getElementById("exemplo1").style.display == 'none') { document.getElementById("exemplo1").style.display = 'block';…
-
-1
votes1
answer102
viewsQ: 'Incorrect datetime value[...]' when using bindParam or bindValue
I am trying to enter a register in the database as follows (PHP) $sql = "INSERT INTO `tb_teste` (`estrutura`, `foto`, `data_cadastro`) VALUES (':estrutura', ':foto', ':data_cadastro')"; $sql =…
-
0
votes2
answers676
viewsA: Persist currentUser firebase with React Native
I’m trying to do it this way, but every time I close the app, currentUser stays NULL firebase.auth().setPersistence(firebase.auth.Auth.Persistence.LOCAL).then(() => {…
-
1
votes1
answer238
viewsQ: Media print cutting table row
I’m doing the CSS for printing a table, basically I remove all page elements and leave only the table when the print window opens. I do this using: <link rel="stylesheet"…
-
1
votes1
answer566
viewsQ: More specific error 500
I am working on a PHP web application. The problem I am facing is that the application is working 100% locally, but when I play on the server some things present the error 500. But the error 500 is…
phpasked Otavio Souza Rocha 545 -
0
votes1
answer237
viewsA: Burger menu closes when I click on a dropdown inside it
I couldn’t solve the problem of clicking and closing the submenu, but I solved the problem by making some media queries that hide the dropdown when it’s mobile and display the items right in the…
-
0
votes1
answer237
viewsQ: Burger menu closes when I click on a dropdown inside it
I have a menu that when opened on mobile turns the responsive burger menu. Inside it I need to have a dropdown link that will display another submenu. So far so good, the problem is that every time…
-
3
votes2
answers159
viewsQ: Post does not send the information
I need to send some information by POST to my controller, and at the same time pass a parameter in the URL. The Url Parameter I can take it easy, the problem is that the POST parameters will not. I…
-
0
votes2
answers910
viewsA: Change the OPTION of a SELECT according to the change made in the other SELECT
You will need to use AJAX to do this var url = ENDEREÇO DA REQUISIÇÃO; //se utiliza MVC aqui você chama o controller var dado = DADOS_QUE_SERÃO_PASSADOS_PELO_POST; //ou get caso o type for get…
-
0
votes2
answers42
viewsQ: Error including js in view
On the system I am working on, there is a php file of js functions: <script type="text/javascript"> function alertaProximaBloqueada(){ [...] } function ManualAluno() { [...] } [...]…
-
1
votes1
answer100
viewsA: Performance Ajax
The two ways are correct, the result will be the same and I believe it will not have a considerable performance difference. I’d use the first situation just because I thought it was more organized.…
-
1
votes1
answer102
viewsQ: PDO execute returns true but does not insert
I am trying to enter a record in the bank using this code: $sql = "INSERT INTO tb_ConteudoExtra (Titulo_ConteudoExtra, Texto, Id_TipoConteudoExtra, Data, Hora) VALUES ('".$nomePagina."',…
-
-1
votes4
answers64
viewsA: jQuery does not return value
I don’t quite understand what you want, but I’ll try to help anyway. You’re only returning something when you don’t select either one... do so: function checkRadioPeriodo() { if (…
jqueryanswered Otavio Souza Rocha 545 -
0
votes1
answer57
viewsQ: Input text value does not come with outerHTML
I need to store an HTML code in the database. I can generate this HTML and display it in a modal the way I want it to. But when I go to save him in the bank, I have to run the remote: var $texto =…
-
0
votes1
answer74
viewsQ: Working in html inside a variable
I have a variable that contains a string with an HTML code, within that code I have some <input type="text">. What I need and I couldn’t find a solution, is to change the value of those…
-
0
votes2
answers2270
viewsA: Problems with special characters á, ç, à, etc with php/mysql
Try to use the commands utf8_decode() utf8_encode() I worked on a system where every bank table had a different coding, what I had to do was utf8_decode(utf8_encode($texto))…
-
0
votes1
answer699
viewsA: Copy text from a tag and paste into a field by pressing a button
If I understand correctly, just do so: <script> $(document).ready(function(){ $("#button2").click(function(){ var texto = $("#cod-voucher").text(); var $temp = $("<input>");…
-
0
votes0
answers48
viewsQ: Content of the <head> tag is in the <body> when I test the site
@EDIT SOLUTION ==  - This error appears between the <body> and gives space difference I have that code: <html lang="en"> <head> <link rel="icon" href="<?php echo…
-
1
votes0
answers42
viewsQ: Run loadScreen while image does not load
In my gallery, when the user clicks next or previous, the code below runs: function galeria(BASE_URL, nGaleria) { $('.splash-load').removeClass('hide'); var conteudo = "<img…
-
-1
votes1
answer317
viewsQ: Upload images "on demand"
On the site I’m developing has a "gallery carrosel" which is nothing more than a slider, where only an image will appear and has arrows for the user to navigate (passes alone the house 5s also)...…
-
1
votes1
answer53
viewsA: Get parameter passed by POST with $.ajax
I managed to solve, I do not know if it is a good practice, but anyway, for those with the same problem: $data=json_decode(file_get_contents('php://input'),1); print_r($data['id']);…
-
1
votes1
answer53
viewsQ: Get parameter passed by POST with $.ajax
I’m having trouble getting the id passed by the ajax date (jquery), what happens is using $_POST['id'] or filter_input(INPUT_POST,'id') empty follow the ajax: $.ajax({ type:"POST", url:…
-
-1
votes1
answer40
viewsQ: Error with accented characteristics
Good afternoon, The accented characters in my system are not working when I bring it from the database, are like this , I have tried to put the meta tag, I have tried to save the file with a…
-
0
votes1
answer93
viewsQ: Authentication external websites
I am using JWT to authenticate access. When I try a GET request from outside my system, it displays this message: snippet of the code where I make the request (js): [...] var cep =…
-
0
votes1
answer392
viewsA: Catch error number Axios
RESOLUTION: I had to add this line to my . htaccess to enable Cors: Header set Access-Control-Allow-Origin "*"
-
0
votes1
answer392
viewsQ: Catch error number Axios
I’m making a request, which returns me error 401, but I can’t get this number axios.post(config.urlBase + 'adicionar_empresa', formData) .then(res => { if(res.data){…
-
0
votes4
answers9708
viewsA: Mask in html and css form only
If anyone wants the mask with DDD (xx) xxxx-xxxx: if(t === "tel"){ if (v.length === 1) i.value = "(" + i.value; if (v.length === 3) i.value += ") "; if(v[5] == 9){ i.setAttribute("maxlength", "15");…
-
0
votes1
answer50
viewsQ: Generate file with JS
I have a query and mount a string with the result. So far everything is ok! What is giving me trouble is to find a good way so that when the query is finished and the string is already mounted, a…
javascriptasked Otavio Souza Rocha 545 -
0
votes0
answers375
viewsQ: onChange on jQuery Input Mask does not work
I have an React component for user registration, in some of the fields I added a Jquery mask, but since I added the mask, the onChange command stopped working (only in the fields with the mask) one…
-
0
votes1
answer589
viewsA: Pass parameters(including an image) to PHP with Axios using formData
I managed to solve axios.post(config.urlBase + 'adicionar_empresa', {empresa:formData}) was passing the parameter in JSON, the correct is so axios.post(config.urlBase + 'adicionar_empresa',…
-
1
votes1
answer589
viewsQ: Pass parameters(including an image) to PHP with Axios using formData
I created an React component to be my custom input button: getFormData(){ var formData = new FormData(); var imagefile = document.querySelector('#btn_file_logo'); formData.append("image",…
-
0
votes2
answers135
viewsA: Changing the styles of Bootstrap form fields
add a class form-personalizado where you want it to have transparent background and edge and in css add this .form-personalizado{ border-bottom: 1px solid #00ff00; background-color:transparent; }…
-
0
votes1
answer150
viewsQ: Error importing class with use
The structure of my folders and files is like this: What I am trying to do without success, is to use the class Validacao.php in the User.php For that I used the command use Classes\Validacao;…
-
3
votes3
answers1052
viewsQ: Image with scroll vertically and height 100%
I have the following structure: <div class="bg"> <img src="view/img/planta-supermercado.png" id="bg"> <div class="bg-scroll" id="bg-scroll"> <img…
-
1
votes1
answer1423
viewsA: Input does not allow typing
I was able to solve, instead of using value in the Component, replace with defaultValue Before: <input type="text" ... value={this.props.value} ... /> Now: <input type="text" ...…
-
0
votes1
answer1423
viewsQ: Input does not allow typing
I have a page with some inputs, I’m using React so I have some components to help when I create the form Form Code: <div className="content novo"> <Alerta ref={(ref)=>this.alerta = ref}…
-
0
votes2
answers151
viewsA: Is it possible to insert and remove at the same time on the same php page?
Just you now play the code to remove from the table you want to remove $sql2 = DELETE FROM hospede WHERE cod_hospede = '$cod_hospede'"; $result2 = mysqli_query($con, $sql2); But take a look at Mysql…
-
2
votes2
answers3284
viewsQ: Child component, return to parent REACT component
I have the following modal: <Modal dialogClassName="clientes-modal" show={this.state.show} className="modal fade"> <Modal.Header className="bg-new"> <h4 ><i className="fa…
-
0
votes2
answers200
viewsA: Select checkbox when placing value from a text box
document.getElementById('checkboxAlmoco').onchange = function(){ document.getElementById('peqAlmoco').checked = true; }; <div> <input id="peqAlmoco" type='checkbox' name='arrachar[$year,…
-
1
votes1
answer151
viewsA: Submit button does not show that it was clicked
Start by adding a Hover effect to css $(".btnAcesso").click(function(event){ $(event.target).attr('disabled', 'disabled'); $(event.target).after('<div…
-
1
votes3
answers2792
viewsA: Click the button and change the background color
See if there’s any doubt var verde1 = document.getElementById("selecao-1"); var verde2 = document.getElementById("selecao-2"); var verde3 = document.getElementById("selecao-3");…
-
1
votes3
answers687
viewsA: How to join values in common php array?
I didn’t have time to test it, but if you follow the logic, it should work. $resultado = []; for(i =0; i<sizeof($vetor); i++){ $resultado[$vetor[i]] = $resultado[$vetor[i]] + $vetor[i]['valor'];…
-
0
votes2
answers495
viewsA: Position div relative to an image
I managed to solve in a more "precise way" I basically used Javascript to take the width of the screen and the image and then subtract (screen - image). After having done this I have the pixel size…
-
2
votes2
answers495
viewsQ: Position div relative to an image
I’m making a kind of map in my application, where an image that grabs the whole screen has several buttons on it. At the moment, I position the buttons this way: .btn_padaria{ left: 75.00%; top:…
-
0
votes1
answer576
viewsQ: Different font on mobile and desktop
In my CSS I put the font Poiret One in the menu of my site. But when I open it on the mobile phone, the font is totally different. Desktop Menu Menu Mobile My CSS is like this: .menu a{ font-family:…
-
2
votes3
answers1130
viewsQ: Break line after IMG with CSS
I’m making the mobile version of a website, but I can’t force a line break after an image that sits inside a modal. This is the stretch that matters in the modal: <div class="modal-content">…
cssasked Otavio Souza Rocha 545 -
3
votes2
answers699
viewsQ: Position div or button inside a specific point of an image
I need to mount a kind of map, where the user clicks on a button that is in the x,y coordinate of an image and a modal opens. I can’t use the background-image for this, so I put the image with…
-
0
votes1
answer37
viewsQ: Jquery code shows different result depending on browser
I’m using a <input type="datetime-local"> but unfortunately it doesn’t work on Mozilla. So I thought to implement something to mask this problem, but for this I need to run a specific code for…
-
1
votes1
answer346
viewsA: Format x-axis values - Google Charts
I managed in a very simple way, just change the type of the column to String, mine was numerical... By doing so you can write whatever you want under the columns…
google-chartsanswered Otavio Souza Rocha 545 -
1
votes1
answer346
viewsQ: Format x-axis values - Google Charts
I need to format the x-axis values in the chart I’m making. I couldn’t find anything in Google to solve my problem: as you can see in the image, the value is so R $ 1000000, I would like to leave it…
google-chartsasked Otavio Souza Rocha 545