Posts by Brunno • 3,531 points
94 posts
-
1
votes3
answers512
viewsA: Add new field and leave it empty
You can use our friend @Jefersonassis' solution by adding the quotation marks in val('), thus: $(this) .parent() .clone(true) .find('select, input').val('') .appendTo( $(this).parent().parent() )…
-
3
votes2
answers413
viewsA: My jquery Cycle 2 slide code does not work. Wondering where the bug is?
The implementation is very simple, you can do it as follows: HTML: <div class="cycle-slideshow" data-cycle-fx="fadeout" data-cycle-auto-height="4:3" data-cycle-delay="-1500" style="height: 222px;…
-
3
votes1
answer1270
viewsA: Fill select with Jquery
Follows a solution using a <input type="text" /> and a <input type="hidden" /> . It consists of taking the event of your auto complete selection and set the description in the text and…
-
2
votes2
answers53
viewsA: Error of Javascript Code
@Gonçalo, according to what he had talked to you in the other Post, you will have to do so, after the focus of the dataFinal field is removed you take the event from blur and calculate. function…
-
4
votes1
answer959
viewsA: How to calculate the days difference using "date" input?
You can use the method below for this, remembering that you can add some checks like: If the start date is less than the end date or if the values are filled in. function…
-
4
votes1
answer64
viewsA: Single call for Jquery plugins?
When you are going to use a lot of Javascript code on a single page, it is important to think about the performance of your application, besides so that your application is prepared to grow is…
-
3
votes2
answers2187
viewsA: Run a Javascript function from the site link?
If I understand your question, it is possible to do this via Javascript as follows: function suaFuncao() { alert('sua função'); } /*Pega o evento de Load da pagina*/ (function() { /*Pega a url…
-
3
votes1
answer384
viewsA: Concatenate in loop with jQuery
You can keep your selector as is and use the functions .map() to generate its array of values, and the function .join('#') to concatenate array positions with the string # as the example below:…
-
5
votes3
answers178
viewsA: Validate a Form
To solve your problem, I propose the following solution. To alert() empty textarea is very simple and remember that you need to validate the field with the file name too! And the process is the same…
javascriptanswered Brunno 3,531 -
1
votes2
answers707
viewsA: Force fields from selected radio
The method .rules() jQuery Validation accepts any selector, you can add class or attribute role in your inputs and from Switch to/remove validations from the val of your radiobox as in the example…
-
2
votes1
answer345
viewsA: How do I make a Content Script communicate with iframe element extension for Chrome?
From what you implied in your question, you need to take the text selection event anywhere on the screen, and save that value into a variable within its extension. If this is really the code below…
-
3
votes3
answers5714
viewsA: How to make Jquery datepicker accept only months and year?
For this jQuery datepicker you can make a hack that works the following way: Add None to the CSS class of the days as below: .ui-datepicker-calendar { display: none; } Soon after you set up your…
-
1
votes2
answers1224
viewsA: Image Preview with JS
To accomplish this task I advise you to use some API like fileinput, as it was mentioned in the link you passed above, as it already has CSS implemented and is already very stable. But even so…
-
20
votes2
answers55629
viewsA: CORS - No 'Access-Control-Allow-Origin' header is present on the requested Resource
In your request from $.ajax, you can pass the crossDomain: true as below: $.ajax({ url: url, crossDomain: true, data: form, dataType: 'json', success: function(data) { console.log(data); }, type:…
-
2
votes1
answer282
viewsA: Check checkbox status - bootstrap switch
Just use .bootstrapSwitch('state'), it will return the status of your checkbox. It follows the events library :) To get the status after loading the page, you can use the code below: //evento…
-
4
votes1
answer78
viewsA: How to put a "page" opening on a piece of the page?
You can use the .show("slow") and .hide("slow") of jQuery to display and disappear with your div. Below is an example code, and here jsfiddle. HTML: <input id="seuInput" type="text" />…
-
6
votes2
answers878
viewsA: How to create a unique method to handle errors with ajax
You can use jQuery’s global ajax events, for example the .ajaxError(). Whenever an Ajax request is completed with an error, jQuery triggers the event .ajaxError() in it you can add your treatment as…
-
2
votes1
answer366
viewsA: How to put a link (href) in a piechart
The best way to solve your problem is by using the Events of Google Charts. In the example below I serve the event of select (event of clicking on one of the parts of the graph), inside it it is…
-
2
votes1
answer217
views -
2
votes2
answers706
viewsA: PACE JS - Page Load Only
For default, this plugin adds the progress bar for all jQuery events, if you only need it in the page load event, you can keep the "startOnPageLoad": true and add the "ajax": false who had avoided…
-
1
votes1
answer26
viewsA: Predetermined messages
Set the content on id field would not be the best choice. Recalling that the id is to store the identifier of your field to manipulate it. to solve your problem and get more semantic, it would be…
-
2
votes3
answers314
viewsA: How to destroy a jQuery.fn whenever called?
Your problem occurs because the events are set cumulatively, to solve this we will depend a little on the way you implemented. I will show two examples with event .click() and with .on() which are…
-
1
votes2
answers967
viewsA: Error caused by line break in append
The problem occurs due to line breaks that prevent the formation of string, which is the argument accepted by append() of jQuery. You can solve this using \ at the end of each line, in which case…
-
2
votes2
answers355
viewsA: Split Divs into group with jquery
Follows a solution using jQuery: Html <button id="btn">add blocos</button> Javascript function adicionarBlocosContencao() { //obtenho todos os elementos com a class .bloco e faço a…
-
1
votes1
answer42
viewsA: How to get the item that is in drag in a Jquery Drag&drop?
You can do this in two ways: $('#seletor').draggable({ drag: function (event, ui) { //só acessar o ui.helper $(ui.helper).css('color', 'red'); } }); or you can also take the event via on and change…
-
4
votes3
answers129
viewsA: Performing dual function not named in the declaration act of the same
You can perform the Anonimas function directly by adding the two parentheses ( ) at the end of each function. They will be executed in a queue process. Follow the jsfiddle and the example below. (…
javascriptanswered Brunno 3,531 -
2
votes1
answer122
viewsA: Edit two tables simultaneously in an "Edit" view
You can create an intermediate class (view model), where you will have two attributes, one of the type Catechizing and Person example: public class CadastroViewModel { public Catequizando…
-
2
votes1
answer152
viewsA: Take data after gridComplete
The object loadComplete receives is a Json with paging and an attribute Rows with the returned data list. another option for you to take the data is to use the example below: var data =…
-
7
votes6
answers14101
viewsQ: String Format with Javascript
Aiming at the String.Format from C#, which is very easy to use, I searched for something similar to be used in my Javascript codes. I found some rather problematic implementations, aiming at this, I…
-
1
votes2
answers954
viewsA: Css change in iOS only
I use this code to detect, it uses the Navigator.useragent and it works well. The code is not my own and unfortunately I no longer have the reference to where I found the code at the time. follows…
-
2
votes2
answers132
viewsA: check if several fields are created in the database
you can use the example below, it checks if the columns exist in the in() if it does not exist it rotates the interval between the BEGIN and the END.. To identify the table columns I used the…
-
9
votes1
answer375
viewsQ: How $.when() and . then() aligned works
In my studies of javascript with Jquery framework, I have come across several times with $.when() and .then() aligned. I would like to know how they work together. an example I came across was the…
-
1
votes2
answers515
viewsA: How to validate drop-down with jquery-validation
You can do it this way form: <form id="form" action "" method="post"> <select name="combo"> <option value="">0</option><!-- Criado primeira opção com valor vazio -->…
-
4
votes1
answer1254
viewsQ: IDE/Text editors for Node.js
What are the best options of IDE or Text Editors for development in Nodejs? My need is to develop large projects with Javascript / Node.js, follows below some of the options I found. If possible…
-
2
votes2
answers29844
viewsQ: Convert date to dd/MM/yyyy ORACLE
How to format sysdate for dd/MM/yyyy on Oracle 11g?
-
2
votes1
answer327
viewsA: Send two models to a View
You can create an intermediate class (view model), where you will have two attributes, one of type Tbendereco and Tbfuncionaio example: public class CadastroViewModel { public TBEndereco Endereco {…
asp.net-mvc-5answered Brunno 3,531 -
4
votes1
answer82
viewsA: Javascript does not recognize number 10
Just add a parseint() to your $(this). val() and if you want to remove the simple quotes from their value it will also work.. var Privileges = jQuery('#privileges1'); var select = this.value;…
javascriptanswered Brunno 3,531 -
1
votes1
answer359
viewsA: ajax auto complete by entering values in all inputs
One of the solutions to solve your problem can be implemented as follows, add a data-val="0" in your input type matricule to be a new default value and a 0_ before the class of your fields as below:…
-
2
votes1
answer1764
viewsA: Click on a link go to another page and show the desired id
On its first page we will have the links on the page as below: <a href="interna.php?exibir=bloco1">exibir 1</a> <a href="interna.php?exibir=bloco2">exibir 2</a> Already on…
-
1
votes1
answer466
viewsA: Asp.Net MVC does not run Jquery after calling Action through "url:"
You could return a Jsonresult with your message, and treat it in the Success of your javascript. Something like: Action public ActionResult Delete(long id) { /*Lógica da sua action*/ //aqui retorna…
-
1
votes1
answer1441
viewsA: how do I get the page link
With this you can get the url var url = window.location.href.toString(); Here is a simple example so that when the user clicks the button, open a window with the url. Making it possible to share…
-
1
votes2
answers608
viewsA: Web Service Mail Test - SSL Error
The two methods below serve to accept any certificate that web services are using private static void SetCertificatePolicy() { // Código necessário para acessar serviços remotos // Evita o erro HTTP…
-
1
votes2
answers511
viewsA: Validation via Javascript
I saw the doubt in the comments above and decided to reinforce what our friend @Fernando Medeiros said in his own code! in your script tag in your Success you will make the following change:…
-
2
votes2
answers2885
viewsA: Blocked cross-origin request
Friend already solved this problem just by adding the tag: <add name="Access-Control-Allow-Origin" value="*" /> on my web config.. follows the full web.config: <location…