Javascripts & Setting Field Value

I am getting frustrated (of course… it is 2AM!)… this seems like it should work. Must be missing something simple… any ideas? This script is behind an “edit” button in a web document. The 1st part places the document in edit mode … the last part does not seems to work, specifically the f.LockStatus.value=“Locked” line. Is this syntax correct? I’m just trying to put the doc in edit mode and set the LockStatus field = “Locked”. After the field is set, it should save while the form remains in edit mode. I’m using the f.submit for this. The LockStatus field does not seem to change.

var f = document.forms[0];

var url;

var editurl;

url = self.location.href.toLowerCase() ;

editurl = url.replace(‘?opendocument’,‘?editdocument’);

location.href = editurl;

f.LockStatus.value=“Locked”;

f.submit

Subject: Javascripts & Setting Field Value

After the location.href statement the statement f.LockStatus doens’t do anything anymore because of the requesting new URL.

If you want that parameter set try a get request with an parameter i.e. (//0/?EditDocument&LockStatus=Locked.

Set the default/computed value of field LockStatus: @UrlQueryString(“LockStatus”).

Or create a webqueryopen agent…

hth

Subject: RE: Javascripts & Setting Field Value

Thanks… I could have just created (use this all the time) a URLQueryString -w- the docID, LockStatus and ?EditDocument in the edit button formula (no javascript). This gets me to the document in edit mode -w- LockStatus set. What about the save so that the LockStatus becomes available to others users accessing views (has LockStatus column). Would I just need to make sure that my LS WQO agent saves?