Questions tagged as 'javascript'

1
answer

Compare system time with set time in a variable

How do I compare the system time with a time set in a variable in jQuery or Javascript?     
asked by 25.11.2016 / 17:44
1
answer

How to create a copy of an element, through its property

I want to clone only the images whose attribute alt is "photo". Code var str = document.getElementById('A'); var clone = str.cloneNode(true); document.getElementById('B').appendChild(clone); <span id='A'> <p&...
asked by 25.03.2017 / 17:50
1
answer

JSON in PHP with existing fields printing as Null, how to solve? [duplicate]

I have a SELECT that is not returning me some fields, such as "Notes". In the following image I'm ready the array and see that it is like "Null" the observations field: MyreturnSQListhis:<?phpheader('Content-type:application/json');head...
asked by 27.03.2017 / 20:59
2
answers

Check the type with jquery

Well I have two buttons on a form, they are: <button type='reset' onclick="history.back()">CANCELAR</button> <button type='submit'>ok</button> I have the following jquery that identifies the click on the button and s...
asked by 28.03.2017 / 21:18
2
answers

Encoding of special characters before going to the SQL database

I'm working with SQL Server 2008 and IIS7 to host my MVC website. For security reasons, the website on which I work at this time does not allow strings with special characters like '<' or '>' from <textarea> are se...
asked by 28.03.2017 / 16:54
1
answer

disable double click on every site?

Is it possible to disable double click on the entire site and on any element? Is it possible with jQuery or HTML? I want to prevent the user from giving 2 clicks in a row on links, buttons and etc.     
asked by 28.03.2017 / 16:40
1
answer

Change "on" to "click" in JavaScript function

I want when I click on the radios to call the function, it is currently like this. $("input[name='txtCategoria']").on('blur', function(){ var txtCategoria = $(this).val(); $.get('buscar_tipos.php?txtCategoria=' + txtCategoria,function(...
asked by 25.03.2017 / 16:19
2
answers

Validate different fields with different regex

function validaForm(){ function valida_nome (){ var filter = /^([a-zA-Zà-úÀ-Ú0-9]|-|_|\s)+$/ ; if(!filter.test(document.getElementById("nome").value)){ document.getElementById("nome").placeholder = "Insira o Nome corretamente";...
asked by 24.05.2016 / 23:41
1
answer

How you could hide too many paging numbers

I have the source code already written. Check below: var str = "ABCDEFGHIJKLMNOPQRSTUVXWYZ" var link = []; for(var i = 0; i < str.length; i++) { var letra = str.charCodeAt(i) - 64; link[i] = "<a href='base/dados/"+ letra +...
asked by 04.01.2017 / 16:31
2
answers

How to select only one div of several equals with js?

I'm creating a posts system made with divs , however as all divs will have the same class nomenclature I need that when I click on some javascript attack only own javascript without interfering in others. Only with js, I do not use jquery! E...
asked by 10.01.2017 / 02:54