Questions tagged as 'javascript'

3
answers

Third IF ELSE

So I am a beginner in javascript and I was practicing doing a function that forces the CPF field scores function maskCpf(){ var c_char = document.getElementById("txtCpf").value.length if (c_char == 3){ document.getElementById("txtCpf").valu...
asked by 14.01.2017 / 22:04
1
answer

Text field mask does not work in the mobile environment

I used the following code in jQuery to mask the telefone field for example. jQuery(document).ready(function () { $("#telefone").mask("(99)9999.9999"); }); This code works perfectly on the computer, but on the phone, only the form...
asked by 20.01.2017 / 12:19
1
answer

How to make Chosen ignore accents in the search?

I'm using Chosen in my forms, but I'd like it to ignore the accents when filtering. For example: In a city listing, filter it correctly to: - africa But it does not filter for (as words differ by accent): - africa On the pro...
asked by 14.01.2017 / 23:30
1
answer

Open div via ajax

Gelera, I need to open a div via ajax by passing a ID via POST . Where am I going wrong. HTML <div class="row"> <div id="retorno_galeria"> <a onclick="galeria_id(this.id,' . $gal["id"] . ');" href...
asked by 18.01.2017 / 17:10
1
answer

Validate Jquery does not work with Bootstrap Toggle

I'm using link , a simple toggle of true or false. Here is the code: View: <form id="myform"> @Html.CheckBoxFor(model => model.Permitir, new { id = "toggle1", data_on = "Sim", data_off = "Não", data_toggle = "toggle", dat...
asked by 12.01.2017 / 00:20
1
answer

How to implement a system of undo and redo in javascript?

I see in some native tools in javascript , the redo and undo option, as if it were a Ctrl + z and Ctrl + y , but are graphical tools and not forms. I thought of something like ... The components will be estáticos...
asked by 15.08.2017 / 15:56
1
answer

Desktop notifications - Javascript

I need to send desktop notifications to the user, even when they are not open, but I can only call event notification (click, load, change ...). How could I send these notifications? Notification.requestPermission(function() {...
asked by 11.08.2017 / 22:49
1
answer

How to create a JSON using jquery?

How do I create a JSON with several different names? Same: [{name: "john"}, {name: "pedro"}] Could someone give me an example? I tried to do so, but why does it always return the last item twice? Type John in the first and second, Pete...
asked by 14.08.2017 / 16:18
1
answer

Calculate a date from an initial date and a deadline

I need to select a start date and a period (in months) for the script to calculate the end date in months. Detail: Clicking outside the period field already does the whole calculation showing the end date in the corresponding field. I'm no...
asked by 08.02.2017 / 11:43
2
answers

Serialize with pure JavaScript

Using jQuery I can use the .serialize() method to return in the form of string all the items of the form with their respective values, such as the form below, will return me: nome=dvd&email=dvd%40dvd.com&sexo=1 Form:...
asked by 29.03.2018 / 01:58