Group:  Other Microsoft Office Products ยป microsoft.public.infopath
Thread: Changing the value in a field with vbscript

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Changing the value in a field with vbscript
sead 12.07.2006 18:44:35
I'm trying to change the value of a field in a form to show the UserName of
the person filling-out my form.

I can get the UserName without a problem, but now I can't insert that info.
in the field I wan't to displayit in.

Any help would be greatly apreciated.

sead
RE: Changing the value in a field with vbscript
S.Y.M. Wong-A-Ton 12.07.2006 21:24:02
First you need to choose an event handler in which you are going to load the
username into the field. This could be in the OnLoad event handler of the
form or in an OnAfterChange event of a control. Once you've got that, it's
just a matter of navigating the DOM to find the node corresponding to your
field and then set its text property with something like (in JScript)

XDocument.DOM.selectSingleNode("<XPath_to_your_field>").text = username;

Search this newsgroup on "selectSingleNode" to find more examples on how to
get this done.
---
S.Y.M. Wong-A-Ton


"sead" wrote:

[Quoted Text]
> I'm trying to change the value of a field in a form to show the UserName of
> the person filling-out my form.
>
> I can get the UserName without a problem, but now I can't insert that info.
> in the field I wan't to displayit in.
>
> Any help would be greatly apreciated.
>
> sead

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net