activex - Modify a textbox.value in a form on a webpage which also has the activex vb6

Posted on 2010-01-01
Last Modified: 2013-11-18
I've made a small activex control which shows up on a webpage.
The html webpage also includes a Form with a textbox.
What code do I need in the active-x control to modify the textbox value on the
html-page, where the component resides?

Sample code from the HTML:

<OBJECT id="myvbcomp" name="test1" classid="clsid:758D9CAB-04FE-49BF-AD81-886234C88189"></OBJECT>
<form method="POST" name="mittform">
  <input type="text" name="mintext" size="20" value="textruta">

What code in the VB6 activex alters the value "textruta" on the html textbox?

Question by:Lionheart2010
    LVL 6

    Expert Comment

    I would probably try to raise an event in the activeX control, and handle that event in vbscript or javascript. The event handler can then easily modify the textbox value.

    Something like:

    <script for="myvbcomp" event="UpdateForm(value)">
       document.getElementByName("mintext")[0].value = value;

    Open in new window


    Author Comment

    If I understand you correct, your script above (which should be put in the html of the webpage) "listen" if the ocx raises an event, and then capture the parameter from the Visual Basic 6 ActiveX ?
    The script then alters the textbox on the webpage with the value from the ocx.
    Is this correct?
    LVL 6

    Accepted Solution


    Author Comment

    Yep, now I've learned how to raise events in VB, and it works.
    It also solved my "activate javascript function" from VB OCX question
    Thanks a lot !
     / Richard

    Author Closing Comment


    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Suggested Solutions

    I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
    Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
    In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now