Thursday, August 1, 2019

id and name attributes with underscores not working well for Bootstrap form elements

I came under a weird situation in laravel/bootstrap form whereby a select drop-down's  "select-element.value" in Javascript would remain the same (the very first one) regardless of which option was actually selected.

Turns out the error went away once I renamed the id and name attributes of the select element to a string without an underscore ('_') in it. I looked it up and although theoretically allowed and mostly non-problematic, underscores have a history of issues in id and other element attribute names under different situations and environments and they are therefore not recommended in guides like this one: https://google.github.io/styleguide/htmlcssguide.html#ID_and_Class_Name_Delimiters

1 comment:

  1. A 메리트카지노 few people will win, most will lose, however the house will at all times win. Just how a lot people will lose – and at what social price – has those who try to help drawback gamblers on edge. Signal manipulation through phony applications and software program hacking are some of the the} vital risks difficult the market growth. The online gaming enterprise is also be|can be} experiencing a rising threat of app-based theft.

    ReplyDelete