Posts by placementw • 128 points
10 posts
-
1
votes3
answers65
viewsA: How to decrease the amount of if/Else for the same validation of different object properties?
I believe that something in this format would work the way you expect, just call the function for each field, being able to go through the object testing each property, if there are many, to save…
-
0
votes1
answer31
viewsA: string.Slice() returns empty string
Next, what is happening is that your script runs when the DOM is generated, so the values of the fields are empty. To solve your problem of having the string return empty, just declare the variables…
-
0
votes3
answers59
viewsA: Repeat fields according to dropdown number
Well, you can generate this html through JS, da para fazer assim: I set your values in select, there is no pq starting from 0 if you will iterate to generate inputs <select id="valores5"…
-
6
votes3
answers758
viewsA: Random choices in a Javascript array
Well, the approach to your problem is pretty simple. In JS, I recommend generating a random number from 0 to the size of your array with the.length array, and then accessing a random Dice with that…
javascriptanswered placementw 128 -
-1
votes1
answer264
viewsQ: How to make a Mask input that has more than one mask possible?
I am making a form and using the React-input-Mask component. I am in the phone field part, and would like to accept either the '(99) 9999-9999' or '(99) 9 9999-9999' landline format, but after…
-
0
votes1
answer448
viewsA: Update an array in React state?
Well, my approach to your problem would be as follows:: //(No construtor) this.state = {lista : []}; //(No metodo) let arr_temp = this.state.lista; for(var j=0;j<=vetor.lenght-1;j++){…
-
0
votes3
answers452
viewsA: Javascript - If and Loop
As you want to find the PAR NUMBER resident, you have to do the tests with the 'i' counter, which you are testing with your ifs are the names, which doesn’t help you solve the problem. Another…
-
0
votes1
answer511
viewsA: Manipulating buttons in React.js
I don’t know if I got it right, but in your case, I would treat each HTML element individually. I would put a parameter in the Finish task function, and pass the html element for each function call:…
-
0
votes1
answer75
viewsA: Passing state of a class to a Modal in React Native
Man, I might be wrong because I don’t quite understand your problem, but by your question,: <Atencao posto={this.state.posto} /> And then only access in modal by props, if that was not the…
-
1
votes1
answer48
viewsQ: Pointer from a function does not print
So guys, I got a homework assignment here, I started pointers now and I couldn’t quite understand it, I’ve tried in a lot of ways to pass the "i" value to the main function and print it out, but I…
casked placementw 128