Banging My Head Against the Wall

What I wish I knew before I started…

Tag: jQuery

  • GWT – Adding a click handler to a DIV element

    In jQuery, one popular way to create a simulated button is to create a stylized <div> element and then bind a click event handler to the <div> element like this: <script src=”jquery-1.6.2.min.js”></script> <script> $(‘#clickDiv’).click( function() {     alert(“Div has been clicked”); }); </script> <div id=”clickDiv” style=”padding: 5px; border: 1px solid black; cursor: pointer; width: 100px;”>…

  • Using Grails formatDate in input tag’s value attribute

    In my GSP, I had an input tag where I wanted to set the value attribute to a date, and then use jQuery’s Datepicker widget to render the date field.  The default date format for the Datepicker widget is ‘mm/dd/yy’.  That was fine, but the widget would not show the date selected because the value…