Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Nov 2003
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question need faster way to fill drop down box and display in text area

    hey guys, need to see if someone can come up with a faster way to do things than the way ive done...

    what i have is a simple drop down box which i need to get populated with store corporate numbers 001-599. what i need is for a text area to display a store name and 4 links for each selection of the drop down box...

    what ive had to do is put about 600 option tags and for the store's info and links, ive had to put them in an array using javascript... this is sooo tedious and time consuming. .theres gotta be a better way to do this

    so for example: in the drop down box, "001" would be selected and that would display in a <div> directly under it the text "Store 1: LINK1 LINK2"

    how can i more quickly populate this drop down box? and also, how can i display that data for each corporate number easier?

    right now, i have no serverside languages available to me... is it possible to read it from an excel spreadsheet local? or from a text file?

    thanks for the help!
    i'm always learning

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    Beg, borrow, or steal for server-side.
    This should be in a database and get generated from the server / AJAX.

    Other than that, how would maintaining a excel file or text file be any easier than an array? Normally, no, javascript is client side. It can't read stuff on the server and has no permissions to read from the client.

    If this is not a "normal" web site, mention that, because HTA and other situations do allow for it.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    New Coder
    Join Date
    Oct 2007
    Posts
    49
    Thanks
    5
    Thanked 9 Times in 9 Posts
    Why not have a text input box instead? If they type in the store number, then it loads the store info for that store. If that number doesn't exist, output error message.

    Or, probably a quicker implementation would be to split it up. Have 6 groups of 100, and populate a smaller amount at a time. It gives about an extra 1/2 second of work to the user, but would load the database 500% faster.

    These are only "quick fix" suggestions. Listen to nikkiH and get some server action here.

  • #4
    New Coder
    Join Date
    Nov 2003
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts
    my bad, reason i mentioned i couldnt use server side languages was because this is a "localhost" type site for now. basically a page i pull up on my desktop that has a lot of quicklinks for myself of things i use frequently during the shift at work.

    ive got the dropdown box populated at this point. not looking forward to "filling the array" with each store's info.... lot of copy and paste coding..
    i'm always learning

  • #5
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,915
    Thanks
    2
    Thanked 164 Times in 159 Posts
    Quote Originally Posted by katalyst View Post
    my bad, reason i mentioned i couldnt use server side languages was because this is a "localhost" type site for now. basically a page i pull up on my desktop that has a lot of quicklinks for myself of things i use frequently during the shift at work.

    ive got the dropdown box populated at this point. not looking forward to "filling the array" with each store's info.... lot of copy and paste coding..
    What's stopping you from installing a web server and scripting language on your local station?

    The best and easiest approach is to use a server side language such as Perl or PHP as well as a database such as MySQL and build the page dynamically. IMO, manually populating a javascript array is probably one of the worst approaches.

  • #6
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    Quote Originally Posted by katalyst View Post
    hey guys, need to see if someone can come up with a faster way to do things than the way ive done...

    what i have is a simple drop down box which i need to get populated with store corporate numbers 001-599. what i need is for a text area to display a store name and 4 links for each selection of the drop down box...
    can u post portions of the relevant code?
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #7
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    If you have localhost, how do you not have classic ASP available?
    Are you not on a windows box with IIS?

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/


  •  

    Posting Permissions

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