How to set a value in notes document using javascript

I have a hidden,editable text field1 in my notes document. This field requires to be set from my javascript codes which is written on my notes document using html tags and javascript. Basically what i am trying to achieve is that base on a dynamically populated listbox that base on user on change event will trigger that field1 to be set and submitted. Hope you guys can help me. Cheers.

Subject: How to set a value in notes document using javascript

Hi,I don’t think javascript is capable of accessing back-end data directly anywhere be it in lotus or anywhere else.

You can use AJAX instead for this purpose which will execute an agent on the server to fetch the corresponding data based on the list-box selection and return the text data to the browser which will then be set to the required field. All of it will be done in javascript. Set target url to call the agent in “query_string” hidden field on the form

e.g: http://www.database.nsf/agent?OpenAgent&listbox=data etc…

Note: You will have to parse this data in the agent itself to extract out the data part from the url.

Using this url the agent will be called and the return value will have to be set to “field1” using javascript

e.g. document.form[0].field1.value=returnvalue;

Well all this sounds a bit critical but once you get used to it you find it not very tough to get through.

Hope this will serve your purpose.

Thanks

Sudip.

Subject: RE: How to set a value in notes document using javascript

Hi folks,

Thanks for all your help. Manage to resolve them by shifting the positions of the textboxes. hahaah

Subject: How to set a value in notes document using javascript

Lets suppose the field name is Ltype then foolowing code can work in the Onchange event of field LType:

var FieldValue = document.forms[0].Ltype.options[document.forms[0].Ltype.selectedIndex].text

document.forms[0].Field1.value = FieldValue