I am trying to populate a Field on my form via the OnClick Event. The User would click the “Action Hotspot” and this would populate a different viewable text field on the same form. The form will be used on the Web so I need to do this in Javascript. I am not sure how to do this? I know how to do this in Formula Language:@SetField(“MWPick1”; MidWestTeam1);
@Command([ViewRefreshFields])
but not in Javascript…Any help would be appreciated.
Subject: RE: Populating a Field via OnClick and Javascript
What’s up with the setTimeout()? It’s essentially doing the same thing as refreshing or reloading the window. You need to submit the form in order for the changes to stick.
If you are using the onClick even in Domino Designer, just enter everything between the quotation marks. (By the way, this only works in edit mode, since there are no HTML fields as such on the document in read mode.)
Subject: RE: Populating a Field via OnClick and Javascript
While you can easily create the field(s) in passthru (hidden in edit mode), and change the displayed text, you won’t be able to change a field value directly and have it “stick” while the document is in read mode using JavaScript. A Formula Language button ought to be able to do the job – something as simple as:
FIELD FieldName1 := FieldName2;
@True
That should return the document (with a weird URL) in read mode with the field changed.