ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Im not really sure what you mean. Do you mean that you have an array of values and you want each to be an option? Just use a for or while loop to create each option tag.
I have a HTML drop down menu. there are 10 fields each menu has about 400 options X 10 fields is 4,000 lines of code. It is really slowing down the page. I would like to have the options in a table instead of the HTML. take a look at www.oursubs.com/RT
If you still wish to present the viewer with the same option of finding a menu entry to select their choice, maybe reconsider redesigning the layout of the page to have just one pull down menu, and some sort of Add button, which adds the currently selected menu item to a displayed list. It would require a little Javascript to keep an array of the chosen items, and maybe a nicely formatted area with remove buttons in case of a mistaken choice, but should still provide the same ease of selection instead of having the viewer remember and type in their codes, and then having the recieving page check for any spelling errors.
I'm not sure what you mean by a table. Since you don't want it in the html I assume yuo mean a database table?
You could certainly store them there but you are sill going to need to send the data to the client.
You may want to check your server's network connection. Looking at a traceroute there is a bit of a lag on the last hop - this may be causing you some of the problems.
After reading Proud's post I think I see what you are getting at now. Since the select boxes are all the same you just want the user to be able to make multiple selections from the same choices. Why not use 1 select box that lets you choose multiple options?
Just replace your select tag with something like:
<select name="code" size="15" multiple>
php has a special way of handling multiple selections. If you use:
name="code[]"
Then an array called "code" is created containing the selected items. The first six to be selected will be:
$_POST["code"][0]
$_POST["code"][1]
until
$_POST["code"][9]
If the absolute maximum is 10 then you may want to check that the user hasn't exceded that total. If there is no limit to the number of codes that can be stored then you should probably look at having a seperate link table in your database rather than having X number of code fields in each record.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.