Posts by Renato Diniz • 761 points
32 posts
- 
		1 votes1 answer186 viewsA: disable a php button by with database statusI suppose you’re using PHP mixed with HTML, so it would look something like this: <?php // restante do código onde você pega o status no banco e guarda na variável $status_banco, por exemplo… phpanswered Renato Diniz 761
- 
		0 votes1 answer177 viewsA: Datatable Server Side with JOINWhen using the server-side option, you will have to adapt your server-side code to receive and return the values in a structure defined by the Datatables requests. Datatables sends data with this… phpanswered Renato Diniz 761
- 
		1 votes2 answers79 viewsA: Export jQuery DatatablesTry with the parameter columns: ':visible' in the option exportOptions of the button, that way: "buttons": [ 'copy', 'csv', 'excel', 'pdf', 'print', { extend: 'colvis', text: '+ Colunas',… 
- 
		0 votes1 answer20 viewsA: Disables Datatables Collapse functionYou can disable this behavior with the "Responsive" setting by setting "Details" as false. It looks like this in the Datatable configuration: $(document).ready(function() { $('#tabela').DataTable( {… 
- 
		1 votes1 answer91 viewsA: Checkar all daughter class radiobuttons checkboxUse the Jquery date attribute. With it you can add more information to your elements, in addition to the already used id’s and classes. You can, for example, put a "data-item" attribute (always have… 
- 
		0 votes2 answers93 viewsA: Filter code elementsFrom what I understand, you want to print as HTML only the tag code, and its contents should be shown as plain text. What can be done is to apply a regex to select the text that should be inside the… 
- 
		2 votes2 answers289 viewsA: Computation of Multiplication in JavascriptparseFloat will only understand numbers with decimal box separated by '.' instead of ','. (https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseFloat) Before giving parseFloat,… 
- 
		1 votes1 answer355 viewsA: Check equal data in SQL with onBlurUsing Jquery and Ajax, you could do more or less like this: $("#registro").on("blur", function(){ var valor = $(this).val(); $.ajax({ url: "url_da_pagina_backend", // página onde você acessará o… 
- 
		1 votes1 answer62 viewsA: Jquery notification appear only 1 timeAs the friend Guilherme Nascimento spoke in the comments, it is possible to use the sessionStorage, recording a key, say "displayMensage" and check if its value is "true" (or "displayed" or… jqueryanswered Renato Diniz 761
- 
		3 votes1 answer1011 viewsA: how to put a video inside a pdfUsing iTextSharp, do it as follows: //cria o documento var doc = new Document(); //caminho do arquivo gerado String outfile = "c:/documento.pdf"; //pega instância do objeto PdfWriter PdfWriter… 
- 
		1 votes1 answer206 viewsA: Alert script does not workWhen the page does not even load after uploading a very large file, you need to check that the POST body limit and the file size limit for uploading in PHP is not too low. You can check these values… 
- 
		1 votes1 answer74 viewsA: Checkbox filledThe problem is that the "inactive" JSON field is coming like this: "inativo":"0". The . prop("checked", ...) method gets a Boolean, so we have to convert this "0" to Boolean first, using double… 
- 
		2 votes1 answer62 viewsA: Wait to fill FunctionInstead of keeping the function waiting, you can add an "OK" button to save the given value. This button will call a function that executes the rest of the code you want. See the example: function… javascriptanswered Renato Diniz 761
- 
		2 votes2 answers272 viewsA: Problem using append js element does not appearYou should show again the div that just received the . fadeOut, because now it will be with display:None, ie invisible. Before giving the append also do a div cleaning with the . Empty(), thus:… 
- 
		3 votes1 answer205 viewsA: Custom jQuery Show functionWhat you want is a modal. You could use the Bootstrap or Jqueryui modals, but if you want to make your own, see this example I made: $(document).ready(function() { // Mostra a div… 
- 
		0 votes1 answer970 viewsA: How to solve this problem in Datatables?As specified in official documentation, this error occurs when we try to restart an already started table. By default, Datatables does not let us change a table that has already been created, but… 
- 
		1 votes1 answer686 viewsA: How to take the value of an input, according to a DATA attributeYou can do it this way: $(document).ready(function(){ $(".atualizar").on("click", function(){ var id = $(this).data("id"); var senha = $("input[id='senhaA'][data-id='"+id+"']").val(); var nivelA =… jqueryanswered Renato Diniz 761
- 
		4 votes3 answers752 viewsA: String with JS Function NameI would avoid the use of eval(). You can store your functions in an object (not array, as originally said) of functions and then call passing as key the name of the function you want, like this:… javascriptanswered Renato Diniz 761
- 
		1 votes3 answers641 viewsA: Check if window load is falseThere are two .load in Jquery. The first, which you can see here is an Event Handler for the Javascript "load" event. It is called when a component and all its subcomponents are fully loaded. That… 
- 
		0 votes2 answers1107 viewsA: display:None is not being appliedAdd a class to your CSS containing the display:none: .hidden { display:none !important; } In the code that adds the options of select in the list, check if the option is selected, if it is, add the… 
- 
		2 votes3 answers70 viewsA: Prevent a value from being selected in the dropdownIt is possible to return to the original value using $.date, which stores information in the DOM of the element itself. This avoids the use of global variables or field creation only to store this… 
- 
		2 votes2 answers1396 viewsA: Select with States and Cities SearchWe need to call the .trigger("chosen:updated"); select of cities after the status select is changed or has an option selected. However, if you call immediately, the Chosen plugin ends up trying to… 
- 
		0 votes2 answers372 viewsA: Display text contained in span in HoverFrom what I understand, you want the circle to contain only the exclamation initially, and when the user hovers the mouse, the message is displayed. So what you can do first is give a class to that… 
- 
		0 votes1 answer264 viewsA: Change which "type input" appears$("#tipo_input").on("change", function() { var tipo = $(this).val(); $("span[class^='tipo-']:not(.tipo-"+tipo+")").hide(); $("span[class='tipo-"+tipo+"']").show(); }); <script… 
- 
		2 votes2 answers501 viewsA: Jquery Datatables filter for full phraseYou can search by placing the text in double quotes or disable the Datatable Smart Search function by adding this setting when starting the table: $('#tabela').dataTable({ "search": { "smart": false… jqueryanswered Renato Diniz 761
- 
		1 votes2 answers548 viewsA: Jquery Append does not workTry to give an id to your table and use the code below to see if it works. $("#idDaTabela tr:last").after(...); Update: There also seems to be a problem in how you are selecting the button. Place… 
- 
		0 votes3 answers60 viewsA: Does not concatenate the IfYou’re declaring the print variable before the if’s, so it’s taking the values without the zeroes in front. Place the statement after the if’s and print. javascriptanswered Renato Diniz 761
- 
		1 votes1 answer473 viewsA: Update the inline of an html tableSet a single class for the rows containing the data. After that, after removing the item, you can do this: var contador = 0; $( ".classeDaLinha" ).each(function() {… 
- 
		1 votes3 answers127 viewsA: AJAX - Appearing IvsYou’re returning a script to appear inside a div, I don’t quite understand. Why not return the success/error message as a simple HTML? For example: <p>Mensagem de sucesso</p> And then in… 
- 
		0 votes3 answers1182 viewsA: How do you hide a div when it’s empty?As already said by some, make the div initially invisible. You can even leave the message already set in it: CSS: .divSucesso{ display:none; } HTML: <div id="divSucesso"… 
- 
		4 votes5 answers7927 viewsA: Take name and surname of a stringYou can split the whitespace of the string, then take only the first and second element of the array: var nome = "Renan Rodrigues Moraes"; var tmp = nome.split(" "); nome = tmp[0] + " " + tmp[1];… javascriptanswered Renato Diniz 761
- 
		4 votes1 answer70 viewsA: jQuery does not return to HTMLThe "$(this)" within the Ajax success function is not a reference to its "comment" class object, but rather to the Ajax "jqXHR" object. To get the correct reference, use the "context" option of… jqueryanswered Renato Diniz 761