Javascript and edit mode

On a form I have a button called close…

I have this current simple javascript…

thisForm = window.document.forms[0];

thisForm.SaveOptions.value = “0”;

history.go(-2);

but this only appears to work when the document is new.

If the document is opened in read moved, I get a error for the thisForm.SaveOptions.value=“0” line.

I think it’s because I’m not in edit mode.

So the question begs… how do I in javascript determine if a document is in edit mode or not with a notes form?

Thanks…

Brett

Subject: Javascript and edit mode

Subject: Javascript and edit mode

I’ve tried

thisForm = window.document.forms[0];

if ( thisForm.write ) {

thisForm.SaveOptions.value = "0";

history.go(-2); 

}

else

{

history.go(-2);

}

and it fails…

any help would be appreciated.

Brett

Subject: Javascript and edit mode

Why would yo check the value of the SaveOptions field, while the document is not being edited anyway?

Subject: RE: Javascript and edit mode

On open the field values becomes a “1” when you open the document. When I close the doc (for cancelling), I don’t want to save any changes…

so the field is set to “0”…at least that’s what I’m trying to do…

Brett