Posts by Bruno Cabral • 453 points
19 posts
-
0
votes1
answer73
viewsA: filter a list only by the beginning of the word Angularjs
I found the solution based nessa Question, but I’ve made some improvements <ui-select-choices repeat="city in avaiableCities | CustomFilter:$select.search:'city' track by $index"> 'use…
-
0
votes1
answer73
viewsQ: filter a list only by the beginning of the word Angularjs
I have an input (multiple selection), I am using lib ui-select, I get a city list and need to filter them, the problem is that the Angularjs filter filters the whole word, I need to filter the…
-
0
votes1
answer48
viewsQ: test filter scenario
I would like to know the best way to test (with Jasmine) a filter with this scenario: function districtFilter(city, array) { var districtFound = array.filter(function(a) { return a.id !== city.id;…
-
0
votes4
answers636
viewsQ: Check object array index by property
When you click on an element, I get an id. With this I do it in an array and find out which object has the same id, and need to remove all objects with the same id. function onRemove(city) { for…
-
6
votes5
answers2427
viewsQ: Get clicked element position
I have a list of entries and one of the attributes of that item is a delete button. By clicking the button I want to know the position of the line clicked inside the list. When knowing the position…
-
0
votes1
answer104
viewsQ: Get click (this) element in method
I’m refactoring a SPA using in practice the MVC with classes and etc... I made a method that is called when I click on an element <i> and would like to obtain this element to subsequently…
-
0
votes1
answer216
viewsQ: Get post from a single category with have_posts() Wordpress
I’m showing the latest blog post on an external site I’m developing outside wordpress. <?php //Include WordPress define('WP_USE_THEMES', false); require('./blog/wp-load.php'); //Define quantos…
-
2
votes3
answers1302
viewsQ: receive two houses after the comma
I need to get a cash amount and I’m only getting one house after the comma. example 75.50 I get 7.5 and 7 I need to receive 7.00; I am using Jquery;
-
1
votes2
answers2425
viewsQ: Validate Name Form
I have a question with validation of Html5, I have little knowledge with regex need to validate a form that get only: Uppercase and minuscule letters, with accents and etc; Whitespace; Can’t accept…
-
0
votes2
answers560
viewsA: Values from one form to another
I already solved the problem, and used localStorage $('.link-enviar').on('click', function(e){ var nome1 = $('#nome1').val(); var email1 = $('#email1').val(); var cidade1 = $('#cidade1').val(); var…
-
1
votes2
answers560
viewsQ: Values from one form to another
In the index.html will have a pre-form with name, email, city and UF. I will need to take this data and play for another form that will be in another html file. I have a certain notion in jQuery,…
-
3
votes1
answer2079
viewsQ: Scroll bottom in click event
I need the page to go down to the footer when clicked on a input. Actually when the user clicks on input and starts typing, the jQuery autocomplete is hidden by the mobile keyboard, so when it is…
-
1
votes2
answers2447
viewsQ: fill in right-to-left input
I need two input that I have in an app are filled from right to left... one of the inputs is real value (R$) the other is value in milliliter (ml), I am using a jquery mask (a Maskmoney works right…
-
0
votes1
answer330
viewsQ: put variable in jquery selector
I researched other similar questions, but their answers didn’t help me because, the selector I’m using is different. want to catch a tr in a tbody of a table, using the selector nth-child(n) but in…
-
3
votes2
answers104
viewsQ: Receive only number in money field
I’m looking for a td with jQuery. var linhaTr = $("tbody").find("tr:first-child"); var tamanhoTd = linhaTr.find("td:nth-child(2)").text(); and he returns me for example R$ 5,00. But I need to get…
-
5
votes1
answer448
viewsQ: Division between integer and real number returns Nan
I’m afraid the integer values (example 350) and a real number (example 3.50), need to divide one by the other precisely (3.50 / 350) the result would be 0.01. var tamanho =…
-
5
votes1
answer215
viewsQ: Obtain only numbers in an input that receives XX ml (example: 200ml)
I am using the Jquery mask to automatically put the ml (milliliter) suffix in the input that gets the size of a bottle. being the input id #size: var tamanho = $("#tamanho").val(); An example 200 ml…
-
0
votes3
answers528
viewsQ: Function that returns the position of the smallest number in a vector
Simple... I need to know what the position of a value (the lowest value) within a vector, to find the lowest value I am using the Math.min()but to print the result I need to know at which position…
-
4
votes4
answers1757
viewsQ: Empty input cannot receive zero
I have a form with more or less 5 inputs, at any given time inputs will be worthless, and I want to find out what the lowest value between them, but whenever there is one or more inputs voids it…