Announcement Announcement Module
Collapse
No announcement yet.
Multi-Data form controlling Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multi-Data form controlling

    Hi,

    Not sur eif the subject line helped.....

    I am trying to create a form that will collect information regarding a users location. Currently, I have created a form that contains a few drop-down boxes where each one contains a more refined location, like an address on an envelope. The first drop down will define the country, which then allows me to load a list of states/provinces. Once loaded, choosing from the second will then load the third with a list of cities

    Country >
    - Canada
    - United States
    - United Kingdom
    States >
    City >

    Currently, when the user makes a selection in the first drop down, the form auto-submits and returns to the servlet and runs through the “referenceData” routine (of a Spring’s SimpleFormController). The referenceData routine will then see that a country has been selected and load the appropriate list of states. The form-servlet’s validation routine has been designed to reject such a form submission and return the user back to the form in question where the second combo-box will now be populated.

    Country >
    - Canada
    - United States (selected)
    - United Kingdom
    States >
    - Texas
    - Washington etc…
    City >

    Selecting a state will again auto-submit the form, returning to the servlet’s referenceData routine and doing the same process for loading the cities.

    The Question:

    This seems like a lot of round-tripping to accomplish a dynamic form and I was wondering if (aside from splitting this up into several pages) any one had any better ideas on how to accomplish such a task.

    I did think about pre-loading all values into memory and writing a killer of a java-script, but I though this might be too memory intensive (all countries, all states, all provinces and all cities). Perhaps I am over thinking here.

  • #2
    You could look at AJAX to retrieve the appropriate values without the refresh.

    Comment

    Working...
    X