The syntax of jQuery code how to retrieve radio button items in cycle. For example, you have radio buttons with names, first you need to get them to array. For this case I will do it manually.
The syntax of jQuery code how to retrieve radio button items in cycle. For example, you have radio buttons with names, first you need to get them to array. For this case I will do it manually.
There's a control <select> on your page and you want to use it's value as selected and don't want to allow user to change it. Unfortunately, there's no attribute "readonly" for select as for <input> ones. You can use only attribute "disabled", but in this case its value will not be sent. But there's a trick how to do it.
Some notes about creating visible and invisible buttons in Knockout.js.
There's an equivalent in jQuery to PHP function print_r($array). It's good when you want to see an associative array. Especially, if you get it via some function.
Useful snippet for debugging javascript. It prints out key-value pairs of associative array. In PHP your have function print_r($array), but in Javascript you still have to make your own function.
If you want to apply the same action for multiple selectors in jQuery, you should write down their identificators separated by comma. It can be as simple ID of elements, their classes or something more difficult.
Find tag which contains some text you're looking for using jQuery. It's a common task if you want to modify some elements on page but you can't modify html-code of page.
There's a common constraint in votes or surveys like "choose no more than 3 items". And it's not a good idead to allow user control the checked items quantity. You can easily set constraint to a quantity of checked checkbox items with JavaScript and jQuery. You can just disable unchecked checkbox items if user checked maximum quantity and enables items again in case of unchecking.
For jQuery 1.6+ use .prop() function. I don't think it's a good idea to support old versions and use .attr() or something like this.
Strange behavior of console.log() I have noticed when I created a JS code for SharePoint page. My code used jQuery and SPServices library. The code used to get items from a list and render options for "select" control.
Below I post a part of my function which fills a JS array and renders options for "select" control.