Bear Bibeault

Sheriff
+ Follow
since Jan 10, 2002
Merit badge: grant badges
Forum Moderator
Bear Bibeault currently moderates these forums:
Biography
Author of:
Secrets of the JavaScript Ninja, 1st and 2nd editions,
jQuery in Action, 1st, 2nd and 3rd editions,
Ajax in Practice, and
Prototype and Scriptaculous in Action
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Bear Bibeault

Did you perhaps intend for line 27 to be inside the success callback?
Essentially. The + coerces the value to a number. parseInt gives you a bit more flexibility, such as specifying a radix other than 10.
stockWarehouseLabelInputArray[1] is a string. You'll need to convert it to a number before checking it. As in:


(note the addition of the plus sign)
It's been years (and years) since I've worked with jQuery but if I recall correctly the .focus() wrapper method may not be doing what you think it does.

It sets a handler for focus events, and it's deprecated to boot.

I think what you want (and this is from memory so details may vary) is to call the element's focus method. So something along the lines of:

(assuming there's only one possible match)
It's highly unlikely that the JSP engine will get confused about $'s in JS code.

Again, the focus works as expected until I run this piece of code.  



A disabled control cannot accept focus.
I would place both elements in the same div, and use flex to control the side-by-side layout.
Because div 3 has a display rule of "block".

Investigate flex for the best way to position side-by-side elements.
What code editor are you using? An editor such as VS Code or WebStorm should point out where the unbalanced parentheses are.
That would typically be due to an unclosed parentheses pair, but I'm not seeing such in the code you posted. Are you sure the error is coming from this code fragment?

Some unrelated comments:
  • If rmaNum is a string, you should be using !== vs !=
  • Any reason you're not using modern ES6 notation? Unless you're supporting very VERY old browsers (e.g. IE) your code can be simplified and compacted by using arrow functions and template literals.
  • You can view your local storage in DevTools to see if your set to local storage is working and the value is what you expect. If not, debug how you are setting the value. If so, then it's your local storage fetch that's the issue.

    Be aware that all local storage is stored as strings; so if you are trying to store complex structures they need to be serialized. JSON is the usually technique for that.
    DropBox may be an option.
    1 year ago
    Use the debugger or console.log to see what each factor in your conditional expressions equates to individually. Make sure that they are all as you expect.

    Also, prefer !== and === in comparisons. That way you get xact comparisons without coersions.
    Because you want to return data, not a view, you would not use ModelAndView, you'd return an appropriate ResponseEntity, and mark the controller with @RestController.
    1 year ago