Posts by Leandro • 1,764 points
90 posts
-
5
votes1
answer244
viewsA: Uppercase Input does not work in Document.getElementById
Try it like this: valor = document.getElementById('id_nome').value.toUpperCase(); alert(valor); <input id="id_nome" name="nome" type="text" class="form-control" style="text-transform: uppercase"…
javascriptanswered Leandro 1,764 -
1
votes1
answer1349
viewsA: Change bootstrap btn class Hover
Have you tried using the attribute !important? li.btn-success:hover{ background-color: green !important; } With the attribute in question, priority will be given to background-color defined by you.…
-
1
votes3
answers406
viewsA: Disable input sequence with jQuery
A possible solution would also be to define a class for each group of inputs and associate it with ckeckbox corresponding as example below: $(document).ready(function() { $(":checkbox").on("change",…
-
2
votes1
answer830
viewsA: I cannot change the validation mask by clicking on a Radiobutton
Follow the jQuery script that you must implement to perform the mask change according to the option selected by the user, just fit it to the ids of their inputs and the Asp.net code you have.…
-
0
votes1
answer72
viewsA: plan selector showing value at other imput
That’s what you wanted to do? //função exibe data de hoje no campo cancelamento var dia, mes,ano; function Data(){ data = new Date(); dia = data.getDate(); mes = data.getMonth()+1; ano =…
-
0
votes4
answers192
viewsA: Summing up 3 inputs
That’s what you wanted to do? $(document).ready(function() { jQuery('#valorc1, #valorc2, #valorc3').keyup(function(){ var total = 0; var total = parseFloat($('#valorc1').val(), 0);…
-
6
votes3
answers15107
viewsA: How to change the color of the text typed in the input?
Just put the attribute color as black, follows two examples of how to change the color of input, Example: text with black color input{ color: black; } <input type="text"> Example: text with…
-
2
votes2
answers1708
viewsA: Get all the information from the file that came from the input file
With the script below you can get the name, extension, size, height and width of the image sent by the user: $('#imagem').change(function() { var img = document.getElementById('imagem'); //Obter o…
-
1
votes2
answers2017
viewsA: How do I turn on onclick in my javascript?
Create all buttons with class="botoes" and id different for each, as each must have a unique identifier to facilitate access to it and use the function below. The function below will detect when any…
-
0
votes4
answers903
viewsA: Validation of Inputs with javascript
Follow a way to check the blank fields and alert those that are blank: jQuery(function($){ $("#validar").click(function(){ var valor = ""; var id = ""; $("#cadastro .required").each(function(){…
-
1
votes2
answers55
viewsA: BOOTSTRAP EDITIONS
It may be that there is in some other part of the code a css defining the background with the image in question and this is generating css conflict, to solve this conflict you can use the attribute…
-
1
votes3
answers1179
viewsA: Charset does not work in Javascript
Add the attribute charset in the script statement. Example: <script charset="UTF-8"></script>
-
1
votes1
answer1094
viewsA: Select Option with filters
Following is an example of code with similar logic: jQuery(function($) { $('#marca').change(function() { var marca = $('#marca').val(); switch (marca) { case '': $('#modeloVW, #modeloGM,…
-
0
votes1
answer357
viewsA: By clicking on a link change within the video tag the value of being to the link clicked
In summary you would have to do as demonstrated in the code below. 1º Define all links with the same class; 2nd Place a id unique to each link, as shown in the example below; 3rd Insert the case for…
-
1
votes2
answers254
viewsA: Add Checkbox fields to the Loop
I believe it works like this, just insert the code below inside the while `. $(document).ready(function() { $(".valores").change(function() { var total = 100.00; total +=…
-
1
votes2
answers560
viewsA: Pick up selected textContent from the combobox with javascript
Would that be what you wish to do? jQuery(function($){ $('#salvar').click(function(){ var nome = $('#nome').val(); var tipo = $('#cb').val(); console.log(nome); console.log(tipo); }); }); <script…
-
1
votes3
answers115
viewsA: Comparison with the if
I believe the code would be correct as follows: SetInterval(function () { roundedValue = Math.round( parseFloat( sensorValor ) * 100) / 100; // roundedValue =…
-
1
votes4
answers730
viewsA: Hover CSS affect another element
With the script below while passing the mouse the link will be shown and when removing the mouse, the link will be hidden: $(document).ready(function(){ $("#nome").mouseover(function(){…
-
1
votes1
answer79
viewsA: By clicking on DIV clear textbox
With JS it would look like this: jQuery(function($){ $('.linkmodal').click(function(){ $('#txtid').val(''); }); }); <script…
-
0
votes1
answer83
viewsA: Pick up a dice value and play on var
If your intention is to catch the value of a input, just do the following: jQuery(function($){ var i = $('#numero').val(); console.log(i); }); <script…
-
0
votes3
answers403
viewsA: Loop for inside a function
With the code below you can get the value of href of each item to later make the desired comparisons. jQuery(function($){ $(document).ready(function(){ var elements = $(".btn-nav"); var link = "";…
-
0
votes4
answers2363
viewsA: Javascript - Validating Numeric Field (popup)
You can restrict so that the user does not enter any other character than numbers through a mask for each field. With the mask you can define how many numerical digits each field should have. In the…
-
6
votes2
answers1314
viewsA: I need to add checkbox values (additional snacks)
That’s what you need to do? jQuery(function() { $(document).ready(function() { $(".dias").change(function() { var total = $('input[class="dias"]:checked').get().reduce(function(tot, el) { return tot…
javascriptanswered Leandro 1,764 -
0
votes1
answer137
viewsA: Slidershow Carousel
If it meets your need, you can make a carousel/slideshow as described in this link. In this link there is the complete code and teaching how to do. Example of the link above: var slideIndex = 0;…
-
2
votes2
answers4656
viewsA: How to make a DIV disappear after a few seconds
With the script below you could do this. The '2000' number in the function is the desired amount of seconds multiplied by a thousand, that is, if you want to hide the div in 6 seconds = 6000, if in…
-
0
votes2
answers3037
viewsA: CSS Input Zip code
Only with HTML and CSS I believe it would not be possible, but with jQuery it is easy to do this. Follow example: $(document).ready(function () { var $campo = $("#cep"); $campo.mask('00000-000',…
-
1
votes1
answer796
viewsA: restrict options for type="date" and type="time" fields
To allow selecting only the hours from 8 to 18 in the field time, just use the attributes min and max: Hora <input type="time" min="08:00" max="18:00"> Already with regard to the field of the…
-
1
votes2
answers3119
viewsA: How to perform a Js function when selecting a radio input
Simply call the function using the event change to the radio type camp: jQuery(function($){ $(':radio').change(function(){ alert ("Codigo função"); }); }); <script…
javascriptanswered Leandro 1,764 -
1
votes1
answer51
viewsA: Value of the Select
I changed the script a little bit, I believe that this way works the way you expect, instead of using the structure if else, I used the switch case, because it’s more efficient: jQuery(function($){…
-
0
votes2
answers438
viewsA: Javascript for when clicking on a link it simulates the down arrow key
Would that be? $("#clique").click(function() { $("html, body").animate({ scrollTop: $(document).height() }, 500); }); <script…
-
0
votes3
answers1188
viewsA: How to pick a specific element between several of the same class via jquery?
You can also catch by id field, there will take a specific field, even if they belong to the same CSS class. To call by id, just put the # before the desired field id:…
-
0
votes1
answer111
viewsA: Pick predefined value and assign in another field
Where will this date come from? Will it be a form where the user will enter the date? If so, then you don’t even need to use jQuery, just enter a field of the type date in the form, as shown below:…
-
0
votes1
answer107
viewsA: CSS: How to keep <li> on one page without skipping to the next
A possible alternative would be to tag ul with two or more columns layout, it would save space to fit everything on the same page. ul{ columns: 2; -webkit-columns: 2; list-style-type: circle; }…
-
1
votes1
answer1089
viewsA: Change button link according to a select
To change the link according to the selected option, you could do in several ways, among them, the form shown below. I took the volume field as an example to demonstrate how to do:…
-
0
votes1
answer1017
viewsQ: How to print keeping the page layout?
I’m developing a basic hotel control system. When registering the guest’s entry in a suite, I need to print a "receipt" for the customer, but putting only the function window.print() Javascript is…
-
0
votes1
answer849
viewsQ: Force user to select an item in input type datalist
Good evening guys, I have the following code on a hotel system I’m setting up: <?php include "Hospede.php"; $newHospede = new Hospede(); $rs = $newHospede->listarNomesHospedes(); $qtdHospedes…
-
2
votes0
answers108
viewsQ: Date function returning day of month and incorrect time
I am trying to capture the date and time to check the time the user spent without doing any action on the system, but I am having problems with the PHP date function. The code is as follows:: $agora…
-
1
votes2
answers154
viewsA: How to simplify Hexadecimal code #ff6a00
One way to simplify would be to replace the hexadecimal code of the color by the name of the same table has the names and hexadecimal codes of each color. Example: background-color: #ADFF2F has the…
-
0
votes1
answer32
viewsQ: Select - Time comparison does not work
I am trying to make a query to eliminate results in which the end time of the event is equal to 00:00:00, I made the query this way: select nome, local, hora_inicio, hora_fim, data_inicio, data_fim…
-
2
votes2
answers207
viewsQ: Print full day of the week adding one day
I am trying to print the full day of the week (Monday, Tuesday...) of a date returned from the database. However, it is always printing with a day less, for example, instead of printing Monday, it…