Questions tagged as 'javascript'

2
answers

How to find the closest number with JAVASCRIPT

I have a input which receives a value entered by the user and an array with 12 values .. I'm traversing the array with a ForEach .. since I need to find the approximate value of the value typed in input .. I have the following code...
asked by 02.10.2017 / 02:30
1
answer

Dynamic list ordered with search data

I have a problem to display data coming from a database in an orderly way, I have a field for the user to enter with the ID and it returns the user name, and when it is looking for more users the previous ones should hold. <?php $a = $_...
asked by 17.10.2017 / 20:04
2
answers

How to Change IFs to For

I have 3 dropdowns with equal values (0,1, 2 and 3). Where 0 is 'Select a collaborator' 1 is 'Fábia' 2 is 'Helio' 3 is 'Sueli' I have to select a value in one of the dropdowns and disappear from the others. Example: I select Sueli in the first D...
asked by 16.10.2017 / 18:09
1
answer

Display an ALERT and redirect the page

I have a page where the form is with an action that sends the form information to another page. I would like a confirmation message (or denial) to be displayed after the registration has been entered, and after clicking the OK button, there w...
asked by 18.10.2017 / 12:14
1
answer

How do I open a window, type windows explorer, from a website

I'm developing a website that will work with images. The pictures are in the local micro. I want to get all the images (they are + - 10 images) that are in a folder and put them in a grid. Then to allow a zoon to be given. I'm thinking that thro...
asked by 27.09.2017 / 18:43
3
answers

Add button to add fields

I'm trying to implement a button to add extra fields, in which case I'm creating an activity report where it contains 5 fields. When the button is clicked it adds another 5 of those same field. I currently have: JavaScript $(function (...
asked by 16.10.2017 / 21:00
2
answers

Complete decimal places, "00" JavaScript

People I have the following function that I am using to use Currency masks <input class="valr-parc" type="text" name="valr-parc" /> <script> String.prototype.Moeda = function() { var v = this; v = v.re...
asked by 01.11.2017 / 06:06
2
answers

Requesting ajax with append before opening modal

For some reason I'm not able to make this append work. function mostrarUploads(id) { $.ajax({ url: "/painel/mostrarUploads", async: false, method: 'POST', data: {_token: jQuery(".token").val(), id: id}, succes...
asked by 31.10.2017 / 19:26
1
answer

Distance in meters between two coordinates using JavaScript

Can you help me with solving a problem? I need to calculate the distance in meters between two GPS coordinates. But I need to do this using pure JavaScript. The context of this is that my application needs to validate the coordinate of a cust...
asked by 01.11.2017 / 02:37
1
answer

Modularize NodeJs Connection with PostgreSQL

I'm having trouble creating a module in nodejs to export my connection to PostgreSQL . I could not understand why the second code does not work because I would like to export connect already. Code 1 . var pg = requ...
asked by 31.10.2017 / 02:57