[Javascript] Thoughts on building form elements/similar divs

Paul Novitski paul at novitskisoftware.com
Wed Jul 6 17:14:18 CDT 2005


Glenn,

I can think of a few possibilities, but here's the one that might be the 
fastest from the user's point of view:

- Mark up your document with eight input fields (type="text") for the eight 
locations, plus just one instance of the select list.

- Begin with all eight input fields hidden and the select list positioned 
where the first input field would be if it were showing.

- After the user selects from the list, copy the selected list value to 
input field #1 and re-position the select list on top of input field #2.

- If the user changes their mind and clicks on an already-populated input 
field, use its value to select the corresponding item in the select list, 
position the list on top of the input field, give it focus, and hide the 
input field.

What I'm describing is vaguely analagous to right-clicking on images to 
bring up a menu of options: the menu will be the same in every case, 
regardless of which image is right-clicked on.

2300 options is huge!  Another approach to this problem might be to reduce 
the size by grouping items, tree-fashion, into two or three linked lists.

Regards,
Paul


At 02:22 PM 7/6/2005, Glenn E. Lanier, II wrote:
>I am working on an application that allows the users to request an item be
>mailed to various locations -- maybe only one place, maybe multiple places (up
>to 8).
>
>I have all 8 locations in separate divs (div1, div2, div3, etc). I hide div2-8
>when the page is displayed, and only show them if user wants to add a 
>location.
>
>Contained in the location div is a select box with approximately 2300 items.
>This means when the page is being loaded I am building 8 select boxes, and
>transferring the same 8 select boxes.
>
>Since I've done very little JavaScript coding, is there a way to create these
>divs using JavaScript that will allow the page to load faster and not take
>several seconds once the Add location link is selected?
>
>Thanks,
>Glenn
>
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list