Posts by Matheus Cuba • 354 points
14 posts
-
2
votes3
answers992
viewsA: Concatenate elements
You do not need to concatenate into the string, you can use jQuery’s element handling methods: var valorID = 'meuID'; var valorPosicao = 20; var minhaDiv = $('<div>'); //Criando a Div…
-
0
votes3
answers96
viewsA: How to change label type within a table depending on what is inserted
You can just go through your table with the each() jquery and use a Javascript switch to determine which class according to the element value: $(function(){ $('#minhaTable tr td').each(function(){…
-
0
votes4
answers102
viewsA: Problems with click jquery
Your code is working perfectly... Try to check if there are no others Handler’s for the class livro, or check if there is no preventDefault() at the click let dataMock = [ { name: "Harry Potter e as…
-
2
votes2
answers610
viewsA: Mirror inputs with their values
Try this Snippet: Thus, you place a global Rigger on the elements whose attribute name begin with nome (Pun Maravilhoso) $('input[name^="nome"]').keyup(function() { var identificador =…
-
1
votes1
answer1544
viewsA: Log out and redirect user to ASP NET MVC login screen / C#
You can use: System.Web.HttpContext.Current.Session.RemoveAll(); System.Web.Security.FormsAuthentication.SignOut(); I can’t remember in my head now if this snippet of code already redirects to the…
-
1
votes2
answers152
viewsA: Get text inside input with radiobutton input-group-addon
To catch the input selected use: $('input[name="respostacorreta"]:checked') And then climb a level using .parent() to get the next existing input Example: I was too lazy to carry Bootstrap…
-
0
votes2
answers39
viewsA: Problems cloning a field using Jquery
How are you placing rows in a table with no set size, at the time of .append() element will not respect line size because of class form-control of Bootstrap which implies width:100%. Try just…
-
3
votes1
answer3414
viewsA: How to navigate between tabs of a bootstrap panel by href link?
Use: $('a[href="#home"]').tab('show'); EDIT To use when loading the Page use in the document.ready: $(document).ready(function(){ $('a[href="#home"]').tab('show'); }); or its abbreviation:…
-
0
votes1
answer22
viewsA: List by jquery and Submit action
It is because when you reload the Page, you need to give trigger in the field, for it to remake the logic that is in your change. Try to put this in your Script: $(function(){…
-
1
votes1
answer1039
viewsA: Insert percentage in progress bar (JAVASCRIPT)
First, it is not a good idea to leave the value to be added fixed in the Code. You can simply count the fields and divide by 100, giving you the amount in % equivalent. Then you can create an Array…
-
1
votes1
answer495
viewsA: Change the visibility of an INPUT with PHP?
If you reload the page when returns the missing data, your <select> back to its original state, even if you mark it as selected. What you can do is simulate the event of onchange when reload…
-
1
votes1
answer98
viewsA: Redirect page if user does not interact (click, touchstart, Mousemove)
Use a function to count seconds, and use the bind below to test User interactions: $(document).on("click keydown keyup mousemove") var segundos = 0; var timer = setInterval(testarInteracao, 1000);…
-
2
votes4
answers96
viewsA: What is the best solution ? Getbyid with a non-existent id in the BD
You can use the following: public VendedorModel GetById(int CPF){ using (var db = new PowerVendasEntities()){ var registro = db.Vendedor.SingleOrDefault(x => x.VendedorCPF == CPF); return…
-
5
votes2
answers210
viewsA: Format date with javascript
Instate the string as a new Date and use the function toLocaleDateString() var data = new Date('2018-01-12T11:25:41+0000'); console.log(data.toLocaleDateString('pt-BR'));…