Monday, March 23, 2009

HOW TO: override __doPostBack function

hi,
this function let u override the doPostBack function
it is ueful when u want to make some action before submit

THE FUNCTION CODE:

var __oldDoPostBack = __doPostBack; // replace __doPostBack with another function
__doPostBack = AlwaysFireBeforeFormSubmit;
function AlwaysFireBeforeFormSubmit (eventTarget, eventArgument)
{
var question = "";
if(eventTarget == "btn_save")
{ // if save was pushed-there is nothing to confirm
__oldDoPostBack (eventTarget, eventArgument);
return;
}
if(statusWasChanged == "false")
{ // if nothing was changed-there is nothing to confirm
__oldDoPostBack (eventTarget, eventArgument);
return;
} else if(confirm("Discard your changes?"))
__oldDoPostBack (eventTarget, eventArgument);
}

My new site

hi,
i just publish a new site:
www.what-is-my-ip-online.com
it lets u:
- find your ip address
- find your user agent
- find yor screen resolution
- find your browser type
i'll be happy to hear any comments/suggestions from u
have a nice week