So when I was using Angular JS, I wanted to set the form in a modal dialog window back to its pristine state whenever it was shown.

Problem was, the form is always undefined. If I place a code within the modal window, the form exists but when I call it in a Javascript function, it is undefined.

The solution is to add $parent to your form name like this:

This will automatically create the form object in your parent controller. Then, you can simply access it using the scope like $scope.myForm.

Well, this one bugged me down for hours. I thought the problem was Bootstrap’s form-control CSS class since removing it shows the Jquery UI DatePicker widget but the input field styling is gone.

User lastoneisbearfood in the StackOverflow forum provided 2 easy solutions of your preference: either adding a css attribute or doing it Javascript style.

on-JS Just add z-index:1051; to the style attribute of your input element. This is based on the observation that bootstrap .modal class uses a z-index of 1050.

Dynamic solution using JS When declaring your datepicker, add a beforeShow handler that retrieves the z-index of .modal and set datepicker’s z-index to 1 higher than that:

User Tim Down from the Stack Overflow forum provided a very handy function to get the rectangle bounds of selected text in Javascript.

This is mighty useful in cases like mine where I wanted to control the visibility of the context menu and that I required it to appear only when the mouse cursor is within the selected text bound.

Related Posts Plugin for WordPress, Blogger...