![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 10 of 14 total |
![]() |
Fri, Jul 5 2013 12:33 PM | Permanent Link |
Sergei Safar | Hi,
suppose you have a TListBox on a TPanel and you execute the Panel.SubmitForm. Only the selected item is submitted. My question is: how to submit all selected items if the TListbox is a MultiSelect one? Best regards, Sergei Safar |
Fri, Jul 5 2013 12:57 PM | Permanent Link |
Dan Fiscalsoft | On 7/5/2013 12:33 PM, Sergei Safar wrote:
> Hi, > > suppose you have a TListBox on a TPanel and you execute the Panel.SubmitForm. Only the selected item is submitted. My question is: how to submit all selected items if the TListbox is a MultiSelect one? > > Best regards, > Sergei Safar > Hi Sergei, There is probably a much easier answer than this, but just an idea in case it helps: Say you submit via a TButton, then create an onbuttonclick event that initiates an iteration with a conditional. So for example, say your ListBox is a list of forms than could be created (something I'm currently working on): i : integer; begin for i := 0 to {index of last item} do if Selected[i] then TForm.create(nil); end; My code may be a little off but I think it illustrates the concept. Hopefully this helps! Dan |
Fri, Jul 5 2013 4:09 PM | Permanent Link |
Ronald | You could put a TMemo onyour panel. Set the property Visible to false and
set the property DataSet en DataColumn to the proper field in your Table. Before you actually submit the panel, you copy the content of the listbox to the memo field. Hope that helps. "Sergei Safar" schreef in bericht news:71699C09-9240-4FE3-9DBA-6CA342B18A77@news.elevatesoft.com... Hi, suppose you have a TListBox on a TPanel and you execute the Panel.SubmitForm. Only the selected item is submitted. My question is: how to submit all selected items if the TListbox is a MultiSelect one? Best regards, Sergei Safar |
Mon, Jul 8 2013 2:41 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Sergei,
<< suppose you have a TListBox on a TPanel and you execute the Panel.SubmitForm. Only the selected item is submitted. >> What back-end are you using ? You should see multiple values come through with the same key value (the listbox control name). You can test this in the IDE using the loopback form submittal address: http://localhost/formsubmit Tim Young Elevate Software www.elevatesoft.com |
Mon, Jul 8 2013 3:50 PM | Permanent Link |
Sergei Safar | Tim,
<<What back-end are you using ?>> PHP and here is a piece of code written in PHP that works fine when EWB submits just one item: $City = $_REQUEST("LBCity"); where LBCity is a TListBox at EWB side. <<You should see multiple values come through with the same key value (the listbox control name).>> I can't see, maybe I am missing something here. Best regards, Sergei Safar |
Wed, Jul 10 2013 11:25 AM | Permanent Link |
Sergei Safar | Hi Tim,
for some reason, PHP is not receiving all selected items, only the last one. Attached print screen of output of a "var_dump($_REQUEST);" command. As you can see only the last selected item is avaiable at back-end side. Best regards, Sergei Safar Attachments: PSubmit.JPG |
Thu, Jul 11 2013 12:04 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Sergei,
<< for some reason, PHP is not receiving all selected items, only the last one. Attached print screen of output of a "var_dump($_REQUEST);" command. As you can see only the last selected item is avaiable at back-end side. >> See here: http://stackoverflow.com/questions/2407284/how-to-get-multiple-selected-values-of-select-box-in-php Tim Young Elevate Software www.elevatesoft.com |
Thu, Jul 11 2013 5:06 PM | Permanent Link |
Sergei Safar | Hi Tim,
<<See here: http://stackoverflow.com/questions/2407284/how-to-get-multiple-selected-values-of-select-box-in-php>> Thank you for your kindly reply. As we know, the names used for the HTML form variables that are submitted are the same as the Name property of the objects. I could see in the HTML example in the link above: <form method="post" action="value.php"> <select name="flower[ ]" size="8" multiple> Note that the form variable "flower" contains brackets [ ]. This way, PHP at back-end can parse the items submited. If I remove the brackets, I get an PHP error message: 'Invalid argument supplied for foreach() " The same error when EWB submits TListBox multiple items. Best regards, Sergei Safar |
Fri, Jul 12 2013 12:54 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Sergei,
<< Note that the form variable "flower" contains brackets [ ]. This way, PHP at back-end can parse the items submited. If I remove the brackets, I get an PHP error message: 'Invalid argument supplied for foreach() " >> This is really a PHP issue. You should consider using the appropriate PHP support venues for finding a solution. The values *do* come through properly from EWB, and should not require any special naming to work with the back-end. Doing so would break other back-ends that don't require special naming. Thanks, Tim Young Elevate Software www.elevatesoft.com |
Mon, Jul 15 2013 10:24 AM | Permanent Link |
Sergei Safar | Hi Tim,
<<Doing so would break other back-ends that don't require special naming.>> yes, I understand. Anyway, I got a solution using TServerRequest, a loop through TListBox selected items sending each one as a parameter. The back-end did the rest. Thank you all for the help and hints. Best regards, Sergei Safar |
Page 1 of 2 | Next Page » | |
Jump to Page: 1 2 |
This web page was last updated on Saturday, April 1, 2023 at 03:23 AM | Privacy Policy![]() © 2023 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |