Posts by abfurlan • 10,570 points
221 posts
-
3
votes3
answers425
viewsA: Javascript : Give . Hide on everything that is open
It is possible to select elements containing part of the id. It is worth noting that there are other easier ways to do this manipulation, as mentioned in the other questions, see an example:…
-
1
votes6
answers1754
viewsA: Hide dives after selecting another category
From what I understand you need to display the div of the category and subcategory, thus: $('#category').change(function(){ $('.group').hide(); // oculta qualquer div group $('.sub').hide(); //…
-
3
votes4
answers1210
viewsA: How to check if an input has a string?
You can check with a regular expression and the method match, see: $("button.nextButton").unbind("click").click(function(e){ e.preventDefault(); var endereco = $("#denuncias_end").val();…
-
3
votes1
answer2407
viewsA: How to increase select with css proportionally
You need to change the following snippets of your code as commented in the code below: .dropdown { display: inline-block; position: relative; overflow: hidden; height: 60px; /*ALTERE PARA O TAMANHO…
-
7
votes2
answers4809
viewsA: How to leave a text centered between two horizontal lines?
There are some ways to do this, one of them would be with fieldset, example fieldset { border-top: 1px solid #333; border-bottom: none; border-left: none; border-right: none; display: block;…
-
4
votes4
answers798
viewsA: Filter <td> with PHP
You can use Domdocument::loadHTML to parse HTML content, example: $html = <<<EOF <table> <thead> <tr> <th>Col 1</th> <th>Col 2</th> <th>Col…
-
3
votes3
answers226
views -
8
votes2
answers11484
viewsA: How to make a dynamic form?
A suggestion would be to use the names of inputs as Array and treat in PHP, example: $(document).ready(function() { $("#novoProd").click(function() { var novoItem =…
-
6
votes4
answers11103
viewsA: How to get the last days of the month in PHP
Another option is to do: $date = new DateTime('now'); $date->modify('last day of this month'); echo $date->format('d'); // somente o dia echo PHP_EOL; echo $date->format('d/m'); //dia e mês…
-
39
votes4
answers35777
viewsA: Is HTML a programming language?
No. HTML is a hypertext markup language HTML is a markup language, used for structural purposes. HTML encapsulates or marks data within HTML tags, the browser then reads and interprets the content…
-
3
votes2
answers936
viewsA: Adding values of selected input’s within another input
You can make a loop by checking the marked ones and putting in a array, and then apply the function join to put the values in the input by separating them by space, for example: Jsfiddle HTML…
-
0
votes3
answers855
viewsA: How to change the selected option in my 'combobox' from a 'li'?
You can put an attribute on li with the option value and add an event onclick, when the user clicks on li you select the option on select, take the example: Jsfiddle HTML <select name="opcao"…
-
3
votes2
answers903
viewsA: Copy a selected option from a select Multiple to another select Multiple with jquery
Follow a suggested implementation Jsfiddle Whether to copy when loading the tab $(document).ready(function(){ $('#cursosrealizados').html('');//limpa cursos realizados //faz loop pelas opcoes…
-
5
votes3
answers1481
viewsA: How to not show img element where src is equal to null
The correct, I believe would be to test via PHP if the image exists, testing for example with file_exists, depends on how your structure is. You can even put in your CSS so that images with the…
-
11
votes2
answers218
viewsA: Quit two PHP Foreachs
You can also use break 2 to get out of both loop´s: Example: Ideone foreach ($order->getItemCollection() as $item) { foreach ($order->getFreight()->getPackageCollection() as $packs) {…
-
1
votes3
answers794
viewsA: Capture content to be pasted
One way would be to delay a little the search for value, I do not know if it is well what you want, but it is as an option: Demo: Jsfiddle $('input').on("paste", function (evt) { setTimeout(function…
-
2
votes1
answer319
viewsA: Doubt how to validate compo with product name[], field is an array
To validate items of type array, place the element name in single quotes in the validation rules, example: Demo: Jsfiddle $("#myform").validate({ rules: { 'produto[]': { required: true } } }); EDIT…
-
2
votes3
answers381
viewsA: PHP takes data from the SPLIT array
You can use the function preg_match and get the values using a regular expression: Demo Ideone $str = '/Date(770094000000-0300)/'; preg_match( '/\d+\-\d+/', $str, $match ); var_dump( $match );…
-
3
votes2
answers1985
viewsA: Clone data insertion box from with jQuery
A suggested implementation would be to have a hidden model, and when the user clicks the clone button, clone with jQuery and do append in the form, example: Demo Jsfiddle HTML <form action="">…
-
2
votes1
answer746
viewsA: Replace javascript does not work in general
Make a replace global with the option, change your replace, for: "SILVANO SILVADO".replace(/A/g,'@'); Demo: Jsfiddle Edited After editing the question, follow the new solution:…
javascriptanswered abfurlan 10,570 -
2
votes2
answers1287
viewsA: Button that when clicked shows only content of certain class
If all content is hidden and is displayed only at the click of the button, you can do Demo: Jsfiddle Example: CSS /*oculta todos os parágrafos dentro da div conteúdo*/ #conteudo p {display:none;}…
-
6
votes2
answers16197
viewsA: How to print a javascript variable inside an html tag?
You can select the element by class name and set the attribute value, example: Demo: Jsfiddle (function() { var porcentagem = '25%';…
-
3
votes1
answer179
viewsA: Insert markup in Progress bar
A suggested implementation with "Stacked", example: Demo: Jsfiddle <div class="progress"> <div class="progress-bar progress-bar-success" style="width: 50%"> </div> <div…
twitter-bootstrapanswered abfurlan 10,570 -
1
votes1
answer189
viewsA: CSS Jitter in Hover menu
I see the problem only in Internet Explorer and Safari. Your code seems to work in Chrome and Firefox, but there are some issues as below: To define two classes for an element, you are doing <a…
-
7
votes1
answer1972
viewsA: How to know the number of "children" of a class?
You can use .children to count the number of children in a class, example: Example: Jsfiddle HTML <div id="classe"> <div>1</div> <div>2</div> <div>3</div>…
-
1
votes1
answer377
viewsA: Enable/disable drop in sortable (jquery)?
You need to check at the time of creation and after the update if a ul contains 4 or more li, and disable the sortable, example: Example: Jsfiddle $(function() { $( "#sortable1, #sortable2,…
-
3
votes1
answer21796
viewsA: Excel Make list and fetch values
A suggestion would be to create a list of then a function PROCV to fetch values from other columns, example: Create a spreadsheet called list which will contain the data to be searched, according to…
-
7
votes2
answers11971
viewsA: How to count selected checkbox quantity
To take the values of checkbox selected, you must first change the selector of your function. No more than one element is allowed with the same id, then I suggest using the name of checkbox or a…
-
0
votes2
answers835
viewsA: How to group dates according to the day of the week
As already mentioned, use field DATE and not VARCHAR for dates, an option would be to group directly in the SQL query SELECT t.user_id, COUNT(t.user_id) as qt_dias, CASE WHEN…
-
3
votes3
answers11791
viewsA: Overwrite a <button> to a <img>
An implementation suggestion, not exactly with button, more also functional: HTML <div class="video"> <a href="#" title="Titulo do video"> <img src="/img/local-da-imagem"…
-
3
votes3
answers1360
viewsA: Select "select" element with jquery
The id of select need not contain the [], change to id="selecionados" <select id="selecionados" name="selecionados[]" size="20" multiple > <option value="A">A</option> <option…
-
17
votes2
answers160740
viewsA: Formula to calculate numerical ranges in Excel
You need to use SE nested =SE(C11<=6;"G4";SE(C11<=10;"G6";SE(C11<=16;"G8";"FALSO"))) In this case it will test the conditions one at a time, when it is less than or equal to 6 returns true…
-
3
votes3
answers138
viewsA: Does every DIV have a relative position?
The standard position is static for any HTML element, if not explicitly specified position: static; Jsfiddle…
-
1
votes3
answers4226
viewsA: How to select multiple results in one row
Its database seems denormalized, I advise if possible, the creation of a table to relate the user to message. But it follows an option using a sub-query to bring users related to the message,…
-
1
votes1
answer58
viewsA: Autocomplete via java doc in sublime
There is a plugin called Docblock with support for Phpdoc. It automatically adds comment that starts with /** and has a * at the beginning of each line. Any line within a documentation block that…
-
3
votes2
answers1879
viewsA: activating the phpmyadmin
Try to do the following, stop all services and initialize again, use the commands below to stop services sudo opt/lampp/lampp stop sudo /etc/init.d/apache2 stop sudo /etc/init.d/mysql stop OR sudo…
-
3
votes3
answers2402
viewsA: To assign the chosen value in a select (HTML) to a php variable
Taking into account @hugomg’s response, and considering that select is already inside the form, there is one more fix to do. Your select is mounted in the wrong way, the name should stay in the…
-
16
votes2
answers55209
viewsA: Set OPTION as SELECTED based on database values
An option too, would be to test the value for each option and print selected when corresponding, example: <label>Tipo Beneficiario: </label> <span> <?php echo $TipoBeneficiario;…
-
4
votes6
answers16533
viewsA: How to mount the HTML of a "select" via PHP, using data from DB
An option, which I particularly like to use, separating as much as possible the PHP of HTML: <?php $con = new mysqli("localhost", "root", "senha","bancodedados" ) or die (mysql_error()); $query =…
-
2
votes2
answers213
viewsA: Error saving php mysql schedule
Try to define the Timezone standard to be used in time functions, example Timezone São Paulo: ini_set('date.timezone', 'America/Sao_Paulo'); or date_default_timezone_set('America/Sao_Paulo'); See…
-
0
votes2
answers1389
viewsA: add/remove array to an Hidden input
I agree with Sergio’s answer, maybe it is better to reevaluate the way to capture the parameters, more if you want to maintain this strategy, follow a suggested implementation 1º When adding…
-
2
votes1
answer1710
viewsA: Pass parameters by jquery through a table
You can capture the click on tr and mount the object, example: $('table tbody tr').click(function(){ var obj = {}; $(this).each(function(){ obj = { _cnpj: $(this).find('td').eq(0).text(), _razao:…
-
6
votes6
answers4316
viewsA: Know number of checkbox selected
I will leave a suggested implementation HTML <label><input type="checkbox" name="ch" /> Opção</label> <label><input type="checkbox" name="ch" /> Opção</label>…
-
3
votes2
answers9506
viewsA: Validate Radiobutton with jQuery
You can put a return false after the alert: jQuery(function(){ jQuery('#Button1').bind('click',checkRadio); }); function checkRadio() { var isChecked =…
-
2
votes2
answers971
viewsA: Paint top titlebar of a table with bootstrap
You can do in your CSS table thead tr td {background-color:red;} Fiddle
-
4
votes1
answer227
viewsA: How to avoid duplicity with Canonical link?
A controversial subject that creates a lot of confusion and debate, understanding a little how the two work: Redirect 301 It tells search engines that the page is no longer at that address and has…
-
5
votes1
answer556
viewsA: Find character in a php array
To replace values in a array you can use the function preg_replace() $meu_array = array("123_rui", "125_joao", "287_manuel"); $procurar = "/123/"; $substituir = "10"; $meu_array =…
-
9
votes3
answers13425
viewsA: What is an interpreted language? Is Java interpreted?
What is an interpreted language? It is a programming language where the high-level code written by the programmer is interpreted by another computer program and then executed by the operating…
-
4
votes1
answer12235
viewsA: Resize <td> using bootstrap
For tables you can use the same pattern as the division of div. <tr class='row'> <td class="col-xs-2 col-sm-2 col-md-2 col-lg-2">col 1</td> <td class="col-xs-4 col-sm-4 col-md-4…
-
4
votes2
answers3522
viewsA: Multiple objects in jquery selector
You can use the method add() to combine objects in a set var bola = $("#bola"); var casa = $("#casa"); $(bola).add(casa).css("background-color", "blue"); Jsfiddle Option jQuery does not allow adding…