jQuery makes playing with the DOM elements so easy and concise that its just not possible to think of any other approach. So as an example, if I wanted to select all checked radio buttons with their ids starting with ‘spec’ with value = ‘no’ $(“:input[id^=’spec’][value=’no’]:radio:checked”) For text fields, the usual way to access the […]Read more "jQuery – Playground"
While working on some assignment in rails the other day, I came across a weird issue related with rails validations and re rendering of views upon actionrecord validation failure. The issue was composed of two parts. 1. Re rendering the form on validation check was messing the form layout. 2. Only IE was showing the […]Read more "Rails Validations – fieldWithErrors"
Quick Tip: In case you need to wrap a long line of text, all you need to add to the div is the following property word-wrap: break-word;Read more "CSS: Word Wrap Long Text"
Resources for creating favicons are http://www.favicon.cc/ http://favicon-generator.org/editor/ You would be able to create simple and animated favicons here. And to include them in your application, all you have to do is place the favicon in the public directory and add the following line in the html head tag. <link rel=”shortcut icon” href=”/favicon.ico” type=”image/x-icon” />Read more "Favicon"
So I got stuck with the problem of counting the text fields with ids like ‘field1’, ‘field2’, ‘field3’ etc. <input id=’field1′ name=’somename_one’/> <input id=’field2′ name=’somename_two’/> <input id=’field3′ name=’somename_three’/> I need to get the count of such dynamically generated fields. With JQuery, it can be done simply with the following statement: $(“:input[id^=field]”).length This statement will […]Read more "JQuery: Count elements with similar ids"