ActiveX Control Variables to server?

Results 1 to 2 of 2

Thread: ActiveX Control Variables to server?

  1. #1
    gbrethen Guest

    Default ActiveX Control Variables to server?

    how can i pass the variables from an ActiveX Control that i created, to the server, or asp page? Sort of like passing form variables to an asp page! Need Help!!

  2. #2
    Join Date
    Dec 1969

    Default RE: ActiveX Control Variables to server?

    I assume that, on the Web page you created, you have access to the values "in" the ActiveX control from client-side JavaScript and/or VBScript. <BR><BR>If that assumption is not true, you can stop reading.<BR><BR>If it is true, then the "trick" is simply to copy all the needed values from the control to "Hidden" form fields when the page is submitted. Thus something like this:<BR><BR>&#060;FORM Name="MyForm" Action="NextPage.asp" Method="Post"<BR> onSubmit="copyAll(); return true;" &#062;<BR>&#060;INPUT Name="whatever" Value="this is a visible form field" ...&#062;<BR>...<BR>&#060;INPUT TYPE=HIDDEN Name="FromAX1"&#062;<BR>&#060;INPUT TYPE=HIDDEN Name="FromAX2"&#062;<BR>...<BR>&#060;/FORM&#062;<BR><BR>and then you need:<BR><BR>&#060;SCRIPT Language=JavaScript&#062;<BR>function copyAll( )<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;formObj = document.MyForm<BR>&nbsp;&nbsp;&nbsp;&nbsp;axObj = ... get a ref to the activeX object ...<BR>&nbsp;&nbsp;&nbsp;&nbsp;formObj.FromAX1.val ue = axObj.whatever1.value;<BR>&nbsp;&nbsp;&nbsp;&nbsp; formObj.FromAX2.value = axObj.whatever2.value;<BR>&nbsp;&nbsp;&nbsp;&nbsp; ... etc. ...<BR>}<BR>&#060;/SCRIPT&#062;<BR><BR>*******************<BR><BR>tha t&#039s all. pretty simple, really. The posted-to ASP page won&#039t be able to distinguish the values in the hidden fields from those in regular fields. And yes, it is perfectly legal to have a form that has zero non-hidden fields and yet still submit it, if you wish to do so.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts