curtisbeaver
New Member
I've got some client side script that gets the users full name.<BR>What i want to do is use this to set the text value of an asp textbox but can't figure out how to do this.<BR>Any help would be appreciated.errrr.... what?Sorry I thought what I wrote was clear.<BR><BR>Within my HTML I've got this code<BR><BR><SCRIPT language="VBScript"> <BR>Function name()<BR>set wshnet = CreateObject("WScript.network")<BR>strDomain=wshnet.userdomain<BR>strUserName=wshnet.username<BR>set objUser = GetObject("WinNT://" & strDomain & "/" & strUserName & ",User")<BR>strName = objUser.Get("FullName")<BR>name = strname<BR>end function<BR></SCRIPT><BR><BR>It returns the full user name.<BR><BR>What I want to do is use this to set the value of a textbox on my form.<SCRIPT language="VBScript"> <BR>Function name()<BR>set wshnet = CreateObject("WScript.network")<BR>strDomain=wshnet.userdomain<BR>strUserName=wshnet.username<BR>set objUser = GetObject("WinNT://" & strDomain & "/" & strUserName & ",User")<BR>strName = objUser.Get("FullName")<BR>name = strname<BR>document.formname.elementname.value = http://aspmessageboard.com/archive/index.php/strname ' note this line<BR>end function<BR><BR></SCRIPT><BR><BR>btw using VBScript on the client is evil. I would assume this is an intranet project?<BR><BR>Yep intranet project<BR><BR>I've worked out what the problem was. I was trying to put client side values into a server control. Changed the control to a normal html text box & all works fine. The only trouble with this is now I cant use server based event handling on this. But thats Ok as I've made it read only to stop inadvertant deletion of the input.