View member feedback to this tip.
This tip shows you how to Code IsNewDoc and IsDocBeingEdited in JavaScript -- two JavaScript equivalents of common @Functions.
function isNewDoc()
{
url = window.location.toString();
url = url.toLowerCase();
if (url.indexOf("openform") == -1)
return false;
else
return true;
}
function isDocBeingEdited()
{
if (isNewDoc()) return true;
url = window.location.toString();
url = url.toLowerCase();
if (url.indexOf("editdocument") == -1)
return false;
else
return true;
}
MEMBER FEEDBACK TO THIS TIP
The code checks for ?editdocument but not for ?edit. There are other ways for a document to swap into edit mode as well.
Doug J.
Do you have comments on this tip? Let us know.
This tip was submitted to the SearchDomino.com tip exchange by member Curtis Stull. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.