Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Location
    Detroit, Michigan, USA
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Migrating to web base app

    I'm migrating an application that was written in VBA to a web based IE platform. Under VBA, populating combo boxes (drop downs) at least at design time was extremely simple. All it's needed is the AddItem methos of the control and that's it. Runtime was a different story , particularly if keeping newly added entries was required. The question is...how can be this functionality replicated under IE 6.0?. For example, I need to use a certain dropdown to "filter" the contents of a second one based on the value of the first one ( that is <select> and <option> tags will be hard coded on the first one). The <select> tag under HTML reacts to the onChange event but how can be the list on the second dropdown created?... assuming of course I have a number of different lists available to match the entry on the first dropdown. Thanks a lot in advance.

  2. #2
    Star Lounger
    Join Date
    Sep 2002
    Location
    Detroit, Michigan, USA
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Migrating to web base app

    Forgot to mention that at this point an ASP approach is not acceptable (although I can't rule it out either....)

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Migrating to web base app

    When you work with applications in the web world, you generally have to work with a web server, application server, and database server. There are a number of things that can be done client-side (using JavaScript or VBScript), but you will quickly discover the need for more functionality.

    In the situation you've described (using a Dropdown box to filter another), you can actually do this with JavaScript or VBScript (IE only). You'll have to create an array that contains all items in the Dropdown list. When the filter is applied from the first Dropdown, use the OnChange event to rebuild the contents of the second dropdown based on the filter. It's not that difficult, but will require a good grasp of JavaScript or VBScript.

    One down side to writing an entire application this way is that you will need to send all data needed for a given page to the client. The other issue is how to easily manage a large volume of data within HTML, JavaScript, or VBScript code.

    The bottom line is that using a server-based language (ASP/ASP.NET/PHP, etc) will make life MUCH easier...

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Migrating to web base app

    Thinking outside the box, you could hardcode multiple "second" drop-downs and then hide and unhide them based on the choice in the first drop-down. But then on the back end you'd need to figure out which one had the "real" value you wanted. Unless you assign it to a different variable at submit time. Hmmm...

    As for how you do stuff to the second control, research the document object model, either in the DHTML stuff at Microsoft.com, or at the W3C site, or in a scripting reference. I tend to use the "document.getElementById(strControlID)" approach rather than the Internet Explorer 4-specific approach. It's a little harder to be rigorous about the W3C standard methods, but I think it's the wave of the future. And it's more cross-browser compatible, if that matters.

    I don't think I have any sample code for populating SELECT controls, but I'm sure you could find some through Google.

Posting Permissions

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