Re: html forms and php
| From: | Richard Davey | Date: | Tue, 31 Jan 2006 16:18:19 +0000 |
| Subject: | Re: html forms and php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-229567@lists.php.net to get a copy of this message | ||
On 31 Jan 2006, at 16:07, Philippe Reynolds wrote:
To resolve this we have to create an array out of our select name: <select name="trucklist[]" size="12" style="width: 150px" multiple> I added the square brakets to the name...now when I select all the options on the list I can read all values individually. Here is problem...my javascripts have stopped working, I can't move options from one list to the next. Here is the javascript I use currently...I would like help in modifing it so that it may work while using the brakets on the name of the select:Keep the trucklist[] as the select list NAME. This will allow PHP to work. Add an ID to the select list: <select id="trucklist" name="trucklist[]" size="12" style="width: 150px" multiple> Now modify your JavaScript to use this ID instead of the form element name when moving. function Move(fromListID, toListID) { fromList = document.getElementById(fromListID); toList = document.getElementById(toListID); etc etc You can now access the fromList select list in the usual way. Cheers, Rich -- http://www.corephp.co.uk Zend Certified Engineer PHP Development Services