ahdrum87
ahdrum87

Reputation: 45

JavaScript to set field in Lotus Notes Web Form

I am trying to have a Wscript agent run when the web form starts in order to set a field with the machine name. I have tried adding this as pass through HTML at the bottom of the form as well as adding it to the onLoad event or the JS Header to no avail. I am a beginner at web enabling a form and adding JavaScript to it in Lotus. Any help would be fantastic. Below is the code:

Field Name: MachineName

{
var ax = new ActiveXObject("WScript.Network");    
f.MachineName.value = ax.ComputerName;
}

Upvotes: 2

Views: 1204

Answers (1)

Tode
Tode

Reputation: 12060

I guess this is not the complete code. At least one line is missing that defines "f"

The curly brackets have no sense in your code...

In the onload- event of the form, this code should work:

var f=document.forms[0];
var ax = new ActiveXObject( "WScript.Network" );
f.MachineName.value = ax.ComputerName;

Of course this will only work in InternetExplorer as shown here

Upvotes: 2

Related Questions