I'm trying to leverage the DirtyFormWarning, but am finding that the warning 
dialog box is being displayed even if no changes are being made to the HTML 
form.  I don't know why this might be happening and tried looking at some of 
the resulting HTML/Javascript code to get some better insight.  The only thing 
that I found strange was that javascript variable 'dirtyFormWarming' was 
initially set to true....here's a code snip of the HTML output:
var dirtyFormWarning = true;

function setDirtyFormWarning(enabled) {
        dirtyFormWarning = enabled;
}

window.onbeforeunload = function(evt) {

        if (dirtyFormWarning) {
                
                
                        var currentFormValue = 
dojo.io.encodeForm(dojo.byId("AddDailyPatientForm"));
                        if (initialFormValue != currentFormValue) {
                                return "You have unsaved changes.";
                        }
                                
        }
        setDirtyFormWarning(true);
};

I would've thought that 'dirtyFormWarning' would've been initialized to 
'false'?  With it being initialized to 'true' I can see why the warning dialog 
is always being displayed w/o the user having done anything.  Btw, the 
'forceWarning' attribute is not being used (just the 'form' and 'message' 
attributes). 

Is there any common/typical culprits that cause this behavior?  Is there anyway 
I can initialize the 'dirtyFormWarning' javascript variable to false?  If 
there's any help or direction someone can point me in, I'd be very grateful.  
Thanks in advance!

 

john




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Tacos-devel mailing list
Tacos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tacos-devel

Reply via email to