Questions tagged as 'javascript'

1
answer

limiting a date field to just numbers

Currently my fields look like this: function formatar(mascara, documento) { var i = documento.value.length; var saida = mascara.substring(0, 1); var texto = mascara.substring(i) if (texto.substring(0, 1) != saida) { docume...
asked by 30.01.2018 / 13:58
3
answers

Decrease the JAVASCRIPT forms

I have a code when the person clicks add the code generates other forms .. but how do I in each form have the option to delete? Note: I do not want to delete the last one added but a certain one. var counter = 1; jQuery('a.add-author').cl...
asked by 29.01.2018 / 13:42
1
answer

Hide element only if visible or vice versa

I'm using the change event in a select field, in which the corresponding option is the id of a div, what I'd like to do is display the selected div and hide the other dives only if it is visible or hidden, in a dynamic way if a div that was hi...
asked by 29.01.2018 / 04:23
1
answer

setTimeout with each loop does not work [duplicate]

count = 1; $("a.btns").each(function() { if ($(this).parent("span").attr("id") == "btn_default") { return; } count++; these = $(this); setTimeout(function() { $(these).click(); }, 10000 * count); }); The problem should...
asked by 03.02.2018 / 22:44
1
answer

How do the Spring MVC ResponseEntity return on a new page?

I have a method of a report controller (posted below), to which I get a PDF. The problem is that it returns the pdf on the same application tab and this is killing it. How can I do to return in a new tab? Post method that is submitted in h...
asked by 05.02.2018 / 00:18
1
answer

Instantiate class with variable

There is a way to instantiate a class in JavaScript with a variable of type string , for example: class User { constructor() { this._name = 'Luiz'; } get name() { return this._name; } } const className = 'Use...
asked by 20.01.2018 / 15:23
1
answer

Only part of the value of an input

Good morning, I'm only trying to get a share of the value of input . Ex: <input type="text" value="João Paulo Silva" id="nome" /> var nome = $("#nome").text(); And bring the following result: joao.silva If anyone kno...
asked by 06.01.2018 / 14:57
2
answers

Unexpected token - React

I'm trying to run a project, but it is displaying an error in the console related to a function I have, the error is as follows: "63:25 error Parsing error: Unexpected token, expected ( function toggleDrawer = (open) => () => { ^ stat...
asked by 07.01.2018 / 23:34
1
answer

I have a problem validating a contact form

HTML code: <section class="contato"> <div class="parallax-targetaf section-0" data-parallax="scroll" data-image-src="img/4.jpeg"> <div class="container cf"> <div class="containerrr"> <form id="...
asked by 06.01.2018 / 03:49
1
answer

php variable within line javascript (Sweet Alert) PHP

I'm creating a message using the Sweet Alert feature, and where I need to display the person name inside an Alert from a PHP variable >. So, I would like to know how I can do it correctly. Obs :. The connection to the database is working...
asked by 27.12.2017 / 17:36