Posts by Gustavo Luciano • 747 points
27 posts
-
1
votes1
answer31
viewsA: Simple doubt in JS - imput to textarea
The method querySelector() returns the first element that corresponds to a specified CSS selector(s) in the document. With this you could change the input for textarea hassle-free. If the selector…
-
1
votes1
answer52
viewsA: How to make the button go to different links? According to the variables of my "form"
Your problem is actually quite simple, just missing a key to close your if. if (color === "Warm Light" && size == "3m X 2m") { And you should leave as default value the cold light on the…
-
1
votes1
answer46
viewsA: Problem executing function with While loop and If condition
I modified a little the structure of your code, I do not know if it will solve your problem, I used an array to record the numbers and when it is the last one performs the sum, as you said it should…
-
1
votes1
answer122
viewsA: How to change the Datatime format in C#?
Try to make the conversion: DateTime.Now.ToString("MM/dd/yyyy");
-
0
votes1
answer32
viewsQ: Blocking options when selecting link in mobile version
Hello I would like to know if there is any way to block page options when holding an image in the mobile version, because in the web version when I step with the mouse in the image (Hover) appears…
-
2
votes4
answers746
viewsA: Limit number of lines Textareafor
You can use javascript to block the number of rows and columns, follow a practical example along with MVC: Example: function limitarTextArea(campo){ var string = campo.value; var novastring = "";…
-
1
votes1
answer63
viewsA: How to keep PHP session during long upload
You can use session_cache_expire() it increases or decreases the expiration time of a session. Take as parameter the time in minutes for the session to expire. We need to declare this function…
-
2
votes1
answer31
viewsA: How to treat the cable according to the level of access?
A possible solution to your question is for example to create 2 headers, and give a echo in the header to be displayed by each user according to their level leaving one visible while the other not.…
-
0
votes2
answers778
viewsA: Switch to next input automatically
You can create a function to focus on the next input by pressing enter by simply passing the id per parameter in an onkeyup function. Example: <script type="text/javascript"> function…
-
2
votes1
answer51
viewsA: Bring model value to Textarea
Try to replace your: <textarea cols=60 id="opiniao" rows="10" name="men_mensagem" maxlength="500" wrap="hard" placeholder=""></textarea> For: @Html.TextAreaFor(model =>…
-
1
votes1
answer28
viewsA: Mysql Pivot Query
You can do as follows using the Internet: SELECT P.SKU, P.NAME, SUM(OP.UNIT_VALUE) FROM ORDER_PRODUCT OP INNER JOIN ORDER O ON O.ID = OP.ORDER_ID INNER JOIN PRODUCTS P ON P.ID = OP.PRODUCT_ID GROUP…
-
0
votes1
answer122
viewsA: Save image URL inside the value of a radio input
You must pass the element by parameter and recover the value in your method: <input type="radio" name="race" onclick="raceimg(this)" value="img/doly.jpg"> <input type="radio" name="race"…
-
-1
votes1
answer346
viewsA: Chrome auto completing input, autocomplete="off" does not work
Try putting a autocomplete="random-string".
-
1
votes6
answers2057
viewsA: Modify the title of a browser tab with Javascript
Try it that way: document.getElementsByTagName("title")[0].innerText = 'titulo';
javascriptanswered Gustavo Luciano 747 -
1
votes1
answer330
viewsA: Basic Auth API connection
Try it that way: public string HttpRequest(string url, string username, string password) { string authInfo = username + ":" + password; authInfo =…
c#answered Gustavo Luciano 747 -
0
votes1
answer36
viewsA: Asynchronous method
Create an async method within your method and try to make the call, remembering that your email sending method should be async: public ActionResult DetalhaChamadao(Chamado objChamado) { // .. .…
-
1
votes1
answer52
viewsA: Create Counter by incrementing a separate Digit every 60 seconds
Check if this is what you want: var cont = 0; var pontos = 0; function contador() { document.getElementById('tempo').innerHTML = cont; if(cont == 60){ cont = 0; pontos++;…
javascriptanswered Gustavo Luciano 747 -
0
votes1
answer722
viewsQ: Doubt Double chained list with ordered insertion
I created everything but my function of deleting is deleting the record but keeping in print the code 0. Could someone help me find my mistake? I would also like to know if my algorithm was…
casked Gustavo Luciano 747 -
2
votes1
answer48
viewsA: Recover the highest value in a column according to the repetition of the second
Try to use it as follows: SELECT MAX(QTD), DATA FROM TABELA GROUP BY DATA
-
7
votes5
answers5490
viewsA: Count the number of months between one date and another
Try to use it this way. DateTime inicio = new DateTime(2018, 03, 21); DateTime fim = new DateTime(2019, 03, 21); TimeSpan ts = fim.Subtract(inicio); DateTime periodo = new DateTime(ts.Ticks);…
-
6
votes1
answer289
viewsA: Drop or Truncate table with 80 million records?
Truncate - is a DDL command that removes all rows from a table. It can’t be reversed, it’s faster and it doesn’t use as much space as undo a delete. Delete - is a DML command used to remove rows…
-
2
votes2
answers213
viewsA: Modify attributes of a label with a dynamic name
Try to use it this way: public partial class Form1 : Form { int contador = 1; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } public void…
-
4
votes4
answers197
viewsA: Correct syntax way in object instance
There is not necessarily a right way to do this instance, the two ways are correct, the main difference is that the first way you can debug the code and access its members separately.
-
3
votes1
answer34
viewsA: How not to play for API response page?
Fix your code using CURL, make sure that’s what you want. <?php error_reporting(0); session_start(); $celular = $_SESSION['celular']; $ddd = $_SESSION['ddd']; $zero = 0; $num_com_zero =…
-
3
votes2
answers83
viewsA: Javascript function does not perform
Try to use Scriptmanager ScriptManager.RegisterStartupScript(this, GetType(), "YourUniqueScriptKey", "alert('This pops up');", true); More details:…
-
1
votes3
answers433
viewsA: Take the JSON return and move to a PHP variable
I suggest you use CURL follows my sample code: <?php $url = "https://api.ipify.org/"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $ip =…
-
0
votes2
answers82
viewsA: Differences between event definitions
Basically the 3 methods will perform the same action. Using Javascript or Jquery really depends on the needs of the project to be developed. Using Jquery makes the development process more agile to…
jqueryanswered Gustavo Luciano 747