Skip to main content

Posts

Showing posts with the label javascript

Detecting Unsaved Changes using JavaScript

I have a requirement to implement an "Unsaved Changes" prompt in an ASP .Net application. If a user modifies controls on a web form, and attempts to navigate away before saving, a prompt should appear warning them that they have unsaved changes, and give them the option to cancel and stay on the current page. The prompt should not display if the user hasn't touched any of the controls.

jQuery click off element event

I have a floating div that gets displayed, and I want it to be hidden when the user clicks off the div. This would be similar to the .hover() funtion callback when hovering off an element. Only I want to do this for click.

Fixed positioning in Mobile Safari

Is it possible to position an element fixed relative to the viewport in Mobile Safari? As many have noted, position: fixed doesn't work, but Gmail just came out with a solution that almost is what I want – see the floating menu bar on the message view.

Jquery counting elements by class what is the best way to implement this?

Ok what i'm trying to do is to count all of the elements in the current page with the same class and then i'm going to use it to be added onto a name for a input form. Basically i'm allowing users to click on an and then by doing so add another one for more of the same type of items. But i can't think of a way to count all of these simply with jquery/javascript.