Posts by Moykn • 376 points
16 posts
-
0
votes2
answers417
viewsA: How to make Tables with different ids for Function javascript
I’ll stick to the problem in your script. The problem is that ID’s should be unique on your page. Therefore, when consulting a node per ID, only one value will be returned. This is where css classes…
-
1
votes1
answer36
viewsA: Closure error on a variable in loop of Outer Scope
Here I answered a question similar to yours. One of the solutions, inclusive, is the same. The problem with your code is that you are always accessing the business variable created in the loop, and…
javascriptanswered Moykn 376 -
1
votes4
answers4957
viewsA: Javascript code does not work
Two things were wrong with your code. (TL;DR) Working version: http://jsfiddle.net/su4rux5o/1/ Now, about the mistakes: We had to convert the value to number before checking if the quantity was less…
javascriptanswered Moykn 376 -
3
votes1
answer144
viewsA: Scope and IIFE in JS
I’ll try to explain what’s going on in the code. The first point worth noting is the "Declaration Hoisting": https://developer.mozilla.org/en-US/docs/Glossary/Hoisting Which means the elevation of…
javascriptanswered Moykn 376 -
2
votes2
answers5078
viewsA: Adding variables with Javascript
I’ll copy Renan Degrandi’s answer just to correct a concept flaw about Javascript. Consider the following code: function soma(){ var pacote = document.getElementsByName('Pacote'); for (var i = 0; i…
javascriptanswered Moykn 376 -
1
votes1
answer287
viewsA: How to know when Collapsible expands or closes?
According to the description of the api https://api.jquerymobile.com/collapsible/#Event-Collapse You can "listen" to these events: $( "#expansorTurma" ) .on( "collapsiblecollapse", function( event,…
-
1
votes2
answers1679
viewsA: remaining characters textarea
I answered a similar question here: /a/95284/2124 It looks like when using a texarea with the maxlength attribute defined there is an error in the character count. Who is preventing you from…
-
1
votes1
answer320
viewsA: Problems with textarea character counter
Using the Fiddle created by Gabriel Rodrigues; I made some changes, removing the maxlength of the textarea (which caused the limitation of the lines, I don’t know the reason) and changed the event…
-
3
votes6
answers886
viewsA: Regular expression to grab the background-image url
A way that would work with Regex (although the code is inelegant) would be: "url(abc.png);url(xyz.png)".match(/url\((.*?)\)/g) .map(function(url){ return url.replace(/url\(|\)/g, "") }); I don’t…
-
2
votes2
answers1678
viewsA: PHP and Javascript - Show alert without updating page
Using jQuery. $("form").on("submit", function(e){ if($("#solicitante").val()==="" || $("#texto1").val()===""){ e.preventDefault(); alert("Preencha todos os campos"); } }); Calling…
-
0
votes5
answers2014
viewsA: Disable a Ubmit and Enable only when radio minimum Buttons is selected
The logic of enable/disable can be greatly simplified. Adding an Handler to the radio Buttons click or change. http://jsfiddle.net/moykn/nY4g5/ Remembering that in case of radio button only one of…
-
1
votes3
answers4213
viewsA: Bootstrap dropdown menu does not work on Asp.net website
From what I’ve seen the code works normally. http://jsfiddle.net/moykn/Lz82E/ Make sure that, in addition to what has already been quoted by Alan R., Jquery is also being loaded even before…
-
1
votes2
answers2181
viewsA: Pass Javascript data to C#method
You can do this without calling any method in C#. An example: http://jsfiddle.net/moykn/N6x3q/ As stated earlier the element id on the side of usually is not the same on the client side, often being…
-
0
votes5
answers1876
viewsA: Retrieve a final value from a json in Javascript
Since you are using google maps to do this, one way to do this is to use the very api they provide. Here an example: http://jsfiddle.net/moykn/N6x3q/…
-
0
votes2
answers680
viewsA: jQuery Toggle Animation
You can do this by using classes to check the status of the form. I made some changes to the fiddle you sent. http://jsfiddle.net/dW6Mb/6/…
-
3
votes1
answer433
viewsA: Masterpage error not located
the "~" is mapped to the root url of the site in your case "/". However, it seems your masterpage is inside novosite. Therefore, considering your current situation, you would either need to change…