Posts by Joao Paulo • 11,760 points
262 posts
-
0
votes1
answer174
viewsA: Add Products to Cart
The ideal is that you make an ajax request by sending the product id to be added in a relational table linking the product id to your cart, in the database. This way you can go out and enter the…
-
0
votes1
answer26
viewsA: clear posthumous fields
I think the ideal is for you to define which fields are mandatory and which are "related fields". When there is a relation between fields you need to have the definition of the order/hierarchy in…
jqueryanswered Joao Paulo 11,760 -
0
votes1
answer212
viewsA: How to get the value <td> of a table from another table?
Comments on your code: $('#tabResumo').parent().find("INVESTIMENTO").eq(4).text(); You are trying to find an html element named "INVESTMENT", ie . What does not exist. Most likely you are looking…
-
0
votes0
answers39
viewsQ: Problem with string value
I’m using a Microsofot Graph API to get some data and I need to use one of the values it returns to me to do an UPDATE. The problem is that the returned value has quotes and bars. Through GRAPH…
-
1
votes1
answer225
viewsA: How to configure the Summernote editor to display a web page within the window?
You can take the html created in Summernote this way: var htmlPagina = $('#idDoEditor').summernote('code'); Create a div where you want to put the result: <div id="htmlGerado"></div> And…
-
1
votes1
answer70
viewsA: Modal does not load Style when initialized automatically
There is always a button to open the modal? If yes, on auto-start you can also test force-click the button instead of that repeated code, since it always works after clicking the button. Thus:…
-
0
votes1
answer154
viewsA: Sharepoint 2010 - Blocking and Unlocking List Fields with Javascript
Apparently your code is correct. Check the name of the group if it is actually matching what is registered in Sharepoint. If you want to try otherwise follow a solution without using Spservices:…
sharepointanswered Joao Paulo 11,760 -
1
votes2
answers1214
viewsA: Repeated values when making an INNER JOIN
In fact it is not bringing repeated values. What happens is that the distinct compares all columns. Just one column in the record is different that it will already separate into two records. To…
sqlanswered Joao Paulo 11,760 -
1
votes2
answers92
viewsA: Allow to open only one div
Try it this way: function addRisco(){ var temFilhos = $("#riscos").find("div").length > 0; if(!temFilhos){ $("#riscos").append("<div>"+$("#riscoform").html()+"</div>"); } } function…
javascriptanswered Joao Paulo 11,760 -
0
votes3
answers478
viewsA: .is() jQuery - how does it work?
Another view is that what . is() does is check that the checked object $("x") matches the given . is("y") selector, returning a boolean. In practice I use it only to check states of the elements,…
-
1
votes1
answer22
viewsA: Doubt Syntax error in PHP / jQuery function
The right thing would be: $(function(){ var html = '<a class="list-group-item list-group-item-action active" data-toggle="list" href="#home" role="tab"><?php echo $retorno;?></a>';…
-
3
votes2
answers49
viewsA: I’m having trouble with the last one
You cannot use 2 elses without conditions followed. Either you place a condition (Else if()), or you close the if "father" with a "}" before the second Else: if(is_numeric($id) && $id…
phpanswered Joao Paulo 11,760 -
1
votes3
answers295
viewsQ: What do I need to know in order to use React as my front-end library?
My doubt is divided into three points: Are there types of applications where the use of React is very efficient? Or where it would be dispensable or not recommended? What would be? What other…
reactasked Joao Paulo 11,760 -
0
votes1
answer63
viewsA: Empty and Append return no value
I think the mistake is on that line: $sql = msql_query("SELECT * FROM mensagem"); The right thing would be $sql = mysql_query("SELECT * FROM mensagem"); There is also an error in javascript…
-
1
votes1
answer91
viewsA: Duplicate JS when sending record
Separate events and declare a global variable to popular form: var $form; $(document).on('click', '.form-delete', function(e){ e.preventDefault(); $form = $(this);…
-
2
votes1
answer30
viewsA: Recover DOM element from a column
If you want to take from the first object it would be: $(linha).find("#qtdVisitantes").text(); If #qtdVisitants is unique (as it should be) just this code: $("#qtdeVisitantes").text(); Another…
-
2
votes2
answers3695
viewsA: Increase the textarea size
The "swal2-input" class of its component has a pre-set height. You can both delete the class from your html: '<textarea id="swal-input2" rows="100"></textarea>', When you add a…
-
1
votes1
answer51
viewsA: Only one chart is displayed per page
You are rendering both graphics using the same ID. Note that in the first php you have a container named container-tt $html1 = "<div id='container-tt' style='min-width: 310px; height: 400px;…
-
7
votes4
answers5024
viewsA: How to disable field with Javascript?
Solution using jquery: First make sure you have added the jquery library to the head and then enter the javascript/jquery code, example: <head> <script…
-
0
votes1
answer32
viewsA: Jquey does not work with inserted elements using . html()
Turn this: $(".uk-text-justify").click(function(){alert('algo')}); Therein: $(document).on("click", ".uk-text-justify", function(){ alert('algo'); });…
-
2
votes1
answer335
viewsA: Ckeditor + ajax registering empty in the bank
According to documentation of the Ckeditor component (https://docs.ckeditor.com/ckeditor4/latest/guide/dev_savedata.html), the way to take the value of the field is as follows:…
-
1
votes3
answers518
viewsA: Remove JQUERY tags
When we place a string in html format inside a jquery $() selector, jquery turns that string into an object that can be manipulated by jquery itself, and then you can extract the text. var msg =…
-
0
votes1
answer631
viewsA: Run javascript on my Chrome extension
I use some automations simply by adding a javascript code as a favorite in the bookmark bar. Creating a new bookmark page and placing the code in the URL field. Example: javascript: var ok="Ola";…
-
1
votes2
answers47
viewsA: Formatting/Punctuation of real values
I gave an organized to facilitate understanding and improve maintenance. Follows the code: var txtVlrSacar = $("#txtVlrSacar").val(); var txtSaldo = $("#lblSaldo").text(); //Retira todas as…
jqueryanswered Joao Paulo 11,760 -
2
votes3
answers73
viewsA: Error in jQuery animation
In fact what you’re doing is throwing the element to the left -200. As the second time he is already in this position you do not notice the function running again. An example of code for you to…
jqueryanswered Joao Paulo 11,760 -
1
votes1
answer781
viewsA: Change HTML code via jQuery
First I would put an Alert inside the click function to check if it is actually entering the function. $(document).ready(function(){ $('#btn-cadastre').on("click", function() { alert("Entrou"); });…
-
6
votes2
answers7757
viewsQ: Is the for attribute of a label element good for something?
I see several code examples where the attribute "for" is set in Labels. But in practice, whether or not this attribute influences something on the page? Ex: <label…
htmlasked Joao Paulo 11,760 -
4
votes2
answers6239
viewsQ: Problem turning input text into uppercase letters
I have a input and I want it to allow real-time capital letters only. This code apparently works perfectly. $("#texto").on("input", function(){ $(this).val($(this).val().toUpperCase()); }); But I…
-
1
votes1
answer322
viewsA: How to validate valid characters for latitude and longitude during typing?
Pretty basic but it worked... $("[id*='" + camposSharepoint.Ocorrencias.LatitudeEvento + "'],[id*='" + camposSharepoint.Ocorrencias.LongitudeEvento + "']").on('keypress', function (event) { var…
-
0
votes1
answer322
viewsQ: How to validate valid characters for latitude and longitude during typing?
I have a text input for typing latitude and another for longitude. I would like the field to allow typing only of characters valid for latitude and longitude. I believe the field should accept only…
-
0
votes1
answer919
viewsA: Date handling problem in an ACCESS/VBA application with SQL Server database
After many searches on the internet and nothing enlightening ended up coming to a post in a forum that clarified the issue. While looking at the design of one of the sql server ODBC tables within…
-
0
votes1
answer919
viewsQ: Date handling problem in an ACCESS/VBA application with SQL Server database
I needed to migrate the database of an application made in vba using access. The database was native to access and passed to SQL Server. In access, as everything is native everything worked…
-
1
votes2
answers2872
viewsQ: How to read a single-line txt file in VBA?
I would like to read a txt file through VBA. All the codes I found on the internet loop the file (to get all the lines I suppose), but I wanted to take just the first line more simply and put in a…
vbaasked Joao Paulo 11,760 -
2
votes2
answers707
viewsQ: Is there any way to insert pre-defined code snippets in Visual Studio?
I wonder if Visual Studio makes it possible to manage snippets of code for easy insertion into files during an edit. Or if there is one add-on do that. Example: I have this bit of code that I always…
visual-studioasked Joao Paulo 11,760 -
0
votes0
answers327
viewsQ: How to create a new database in ORACLE?
I installed oracle database, oracle client e sql Developer num windows 8.1 64 bits. With the installation of the oracle database, a database was created at localhost:1521 But now I would like to…
-
1
votes0
answers96
viewsQ: Problem with changing Trigger
I have a table that receives data all the time, almost every second. This table has a Trigger that after inserting a new row inserts this record in another table. I need to include a new Rigger in…
-
4
votes2
answers476
viewsA: Focus with selected text
Put this code before the Trigger code: $(".autofocus").on("focus", function () { $(this).select(); });
-
0
votes1
answer56
viewsQ: Doubt about loading images in CSS
I would like to optimize the loading of images from my site according to the size of the device that accesses it. My idea is to use media querys in css and depending on the device resolution load a…
cssasked Joao Paulo 11,760 -
0
votes1
answer260
viewsQ: Switch to regex format '0,00' to format '0.00'
I need to make an entry in the database, but I was sent sql to import with the culture (globalization or whatever) wrong. That way the numbers in SQL are in this format: '0,0 ou '0,00' ou '00,00' ou…
regexasked Joao Paulo 11,760 -
2
votes1
answer48
viewsA: Problem with clause IN
The solution I found was to use LIKE and commas. SELECT * FROM BLABLABLA WHERE ',' + '6,5,4' + ',' LIKE '%,' + CAST(4 AS VARCHAR) + ',%' So the main string is in this format: ',6,5,4,' and my number…
-
2
votes1
answer48
viewsQ: Problem with clause IN
I need to use the IN clause in a situation where the in part is a string. Example: SELECT * FROM BLABLABLA WHERE 4 IN ('6,5,4') It causes me this mistake: Conversion failed when converting the…
-
3
votes4
answers116
viewsA: Help with Jquery appear div
Try it like this: $(document).ready(function(){ $("li a").click(function(){ var id = $(this).attr("href"); $(".teste").hide(); $(id).show(); }); });…
jqueryanswered Joao Paulo 11,760 -
3
votes2
answers281
viewsA: Onclick with Javascript denial
I think there are other ways to do what you need to do, but by directly answering your question there is a way to get everything that is not clicked #menu to call a function. Would that way:…
-
8
votes1
answer1205
viewsQ: Do I need to use Try/catch throughout a process chain?
Supposing I have a call in my layer controller for a method in the business layer that leads to another method in the data access layer. Should I use the try/catch in all of them, only in any or…
-
2
votes1
answer2076
viewsQ: How to set a Primary key to an existing table on Oracle?
I usually do it directly from the IDE (Sql Developer), but I need to run the script this time. Assuming the existing table TB_CR_INDICADOR_PERIODO and the column COD_CR_INDICADOR_PERIODO as the…
-
0
votes2
answers1119
viewsA: Auto select a select option from an input
Include Javascript/Jquery: $(document).ready(function(){ $("#estado").on("change", function(){ var estado = $(this).val(); $("#input-order-zone option[sigla='" + estado + "']").prop("selected",…
-
8
votes3
answers21328
viewsA: Create HTML element with Javascript (appendchild vs innerHTML)
I usually generate always via string. I always mount identado so that I have, as soon as I hit the eye, the view of what that code represents. Example: var htmlTabela = "<table> " + "…
-
0
votes2
answers73
viewsA: How can I get the value inside this <td>
With jQuery you can do this way: var valorTd = $(".monetary").text(); // retorna R$ 75,22 var valorMonetario = valorTd.replace("R$ ", ""); // retorna 75,22
-
4
votes1
answer2860
viewsQ: When should I or should I not use the if without keys?
I usually use always with keys because until today I do not know how exactly is the function of if without keys and if Else can also be without keys. Is there any variation in behavior between…
-
2
votes1
answer113
viewsA: How to take out Grayscale in css :Hover
Try it this way: .grayscale:hover { -moz-filter: initial; -o-filter: initial; -webkit-filter:initial; filter: initial; } Running on jsfiddle: https://jsfiddle.net/94dq2eds/5/…
cssanswered Joao Paulo 11,760