Use JavaScript to programatically access NotesDocuments from web

I’m a bit newbie with JavaScript and I don’t know if I can access NotesDocuments programatically with JS from web.

I have this scenario:

I have 2 forms. One form will have a “key field” (to easily access it) and some fields (in fact a long list of fields) populated with UserNames. The other form (the one I have to create documents from the web) has some fields (one of them with the “key field” in order access the other document with the UserNames) and a Button with this code in the OnClick event:

if (validate()== true)

{

submit()

return true;

}

else

{

return false;

}

I need to check if UserName is in some field of the other document before submitting it. In JS Header of the Form, I’ve created a validate() function to perform the check an return true or false… I have the “key field”, the UserName… but I don’t know how to access the other document and his fields.

Some help will be highly appreciated.