ViszinisA Posted October 31, 2007 Report Share Posted October 31, 2007 hello ir shads: <select size="3" name="blahblah" multiple></select> bet vinjsh nestraadaa... Q: kaads ir alternatiivs variants? :) [daudz check boxi? -_-] vnk kad pievieno useri tad vajag atziimeet, kaadas sadaljas ir pieejamas vinjam Link to comment Share on other sites More sharing options...
bubu Posted October 31, 2007 Report Share Posted October 31, 2007 Kāpēc gan lai nestrādātu? Man strādā. Reku no interneta piemērs: http://www.pleth.com/support/developers/fo...form/index.html (* Why are you using the Internet?) Čekbokši ar protams ir variants. Link to comment Share on other sites More sharing options...
ViszinisA Posted October 31, 2007 Author Report Share Posted October 31, 2007 tai linkaa man iedeva "The page you wish to view is either unavailable or you do not have permission to access it." :) <? print_r ($_POST); ?> <br><br> <form method="POST" action="asd.php"> <select size="5" name="klucis" multiple> <option value="1">a</option> <option value="2">b</option> <option value="3">c</option> <option value="4">d</option> <option value="5">e</option> <option value="6">f</option> <option value="7">g</option> <option value="8">h</option> </select> <input type="submit" value="Poga" name="B1"> </form> kods pareizs? laikam, nezinu rezultaats: Array ( [klucis] => 5 [b1] => Poga ) vinjsh atdeva tikai 1 no iezimeetajiem Link to comment Share on other sites More sharing options...
andrisp Posted October 31, 2007 Report Share Posted October 31, 2007 name="klucis[]" Link to comment Share on other sites More sharing options...
ViszinisA Posted October 31, 2007 Author Report Share Posted October 31, 2007 nais :) paldies stulbais frontpage xD un bubu tava linka source tam name arii ir bez [] :( maldina cilveekus Link to comment Share on other sites More sharing options...
bubu Posted October 31, 2007 Report Share Posted October 31, 2007 Tā kā topiks bija iepostēts HTML sadaļā, tad par php pusi nemaz nedomāju. Domāju, ka tu vairāku-itemu iezīmēšanu nevari panākt browserī (tīrā HTML'ā). Uz submitu tai linkā nebija nekam jānotiek, jo tas tikai demonstrēja kā multiple atribūts jāizmanto HTMLā. Kurš te kuru vairāk maldina? ;) Link to comment Share on other sites More sharing options...
andrisp Posted October 31, 2007 Report Share Posted October 31, 2007 Vispār jau, bubu, tajā linkā, ko iemeti, multiselects izmantots nepareizi. Jo kāda gan jēga no multiselekta, ja tam norādīts name="bla" ? Pēdējais izvēlētais elements pārrakstīs pārējos elementus. Bet par topika neatbilstību forumam piekrītu. Maldinoši. :) Link to comment Share on other sites More sharing options...
bubu Posted October 31, 2007 Report Share Posted October 31, 2007 andrisp: to "pārrakstīšanu" dara tikai php "nepareizība" parsējot POST datus. Browseris visus ieselektētos elementus padod korekti skriptam (formā name=value1&name=value2&name=value3). Ja nu netiek izmantots php (skatamies atkal uz foruma sadaļu ;) tad visus datus var normāli saņemt. Arī php tas ir iespējams nolasot POST datus pa tiešo - $data = file_get_contents("php://input"); Cita informācija: http://laacz.lv/2004/11/02/multiple_selects/ http://paste.php.lv/1335 Link to comment Share on other sites More sharing options...
andrisp Posted October 31, 2007 Report Share Posted October 31, 2007 Interesanti.. Link to comment Share on other sites More sharing options...
Recommended Posts