|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
html/dhtl/javascript/asp?!?
Not sure which of these I should be looking under so here is a description. I have seen on several web pages (but cannot find any now I want to have a go) where you have 2 large select boxes and add data from one site to the other or remove it back into the first box. So I am after 3 thinks. What the hell is this functionality called Any poniters please Any pointers to an example or two would be excellent. TA Simon. |
|
#2
|
||||
|
||||
|
Not 100% sure, but is this what your after?
http://www.mattkruse.com/javascript...tbox/index.html |
|
#3
|
|||
|
|||
|
stumpy,
thats the bugger, your a hero. So are they just called javacripts select boxes? TA Simon. |
|
#4
|
||||
|
||||
|
They are just standard HTML form objects. They've got a few names. Most people call them "Select Lists" because their HTML tag is <SELECT>. They have 2 styles, one is where you have a listing of multiple options. The other is where only one option is shown, and you choose items by clicking the down arrow.
To add the functionality you are after, you need to use some Javascript. I've recently used the code found @ that link (thanks aspnewbie), and it works like a charm! If you need a hand submitting the results to a server-side processing script, let me know. |
|
#5
|
|||
|
|||
OK you obviously knew I would have problems. Im using php to capture the data from this lists and am unable to find it ?!?I have attached html & php files. TA Si. |
|
#6
|
||||
|
||||
|
Ok.
1. Add a HIDDEN field to the form. 2. Add the ONSUBMIT event handler to the form - e.g. Code:
<form name="frmSelect" action="foo.asp" method="post" onsubmit="procForm()"> 3. Add this code to your JS include file Code:
function selectGetOrder(cbox) {
var outList = "";
for(var i = 0; i < cbox.length; i++) {
outList += cbox.options[i].value + ', ';
}
return outList;
}
4.Create the procForm() function. In this function, place any error handling you might need. Inside that function, place a call to the selectGetOrder(cbox) function. e.g. Code:
retVal = selectGetOrder(document.frmFoo.selectListName) This function will return a comma seperated list of values. Assign the returned value to your hidden field, then retreive the hidden field using your PHP script. That outta do it! |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Web Development > xfer options between select lists dynamically |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|