>>
APLDN Home

>>
Events

>>
Trainings

>>
APL Books

>>
APLDN Links

>>
Discussion Groups

>>
Downloads

>>
Articles

>>
Library

>>
Learning Tools

>>
APLDN User IO

>>
APL2000.com




General

Author Thread: Dynamically selected options in a form
Ric.Sherlock
Dynamically selected options in a form
Posted: Saturday, September 03, 2005 9:33 PM (EST)

Using webservices I want to create a "page" where the initially selected options in a listbox on a web form are dynamically set based on the user.

 

The basic approach I imagine is for my webservices URI will call an APL function that determines the options to be selected then creates/edits an html file that is sent to the user's browser with those options selected.

 

The question I have is how best to create/edit that html file.

Two possible approaches are:

  1. write the appropriate html code for the options to be selected
    (e.g. <option value="toast" selected="selected">Toast</option>) and output the document to webservices.
  2. write some javascript to the header of the html document that initializes a variable containing an array of the option values to have selected initially.  Use the "onload" event to run a javascript function that selects the option values set in the variable when the document is loaded in the user's browser.

Option 1 seems a bit clunky but keeps all the "work" in APL
Option 2 seems more "elegant" and generically useful but is more complicated given the use of both APL & javascript

I'm tending towards Option 2 at this stage but wondered if there are any other options that I'm missing?




APL2000 Official Web Site

The true "final frontier" is in the minds and the will of people.
-- Gen. Michael E. Ryan, U.S. Air Force Chief of Staff

APLDN Home   |    |  Events   |  Trainings   |  APL Books   |  APLDN Links   |    |  Discussion Groups   |    |  Downloads   |  Articles   |  Library   |  Learning Tools   |  APLDN User IO   |  APL2000.com   |