nottoolate Posted December 9, 2010 Share Posted December 9, 2010 Hello, I'm using PHP and I have a list box where I should be able to select multiple values, that I then submit to run multiple reports. However, when I select two values I only get results for the last selected value instead of both value a & value b. Can anyone help me with my problem? <td style="text-align: right">Job Type:</td> <td> <select name="job_type" multiple="multiple" size="4"> <option value="0" selected>ALL</option> {section name=jt loop=$job_type_list} <option value="{$job_type_list[jt][0]}">{$job_type_list[jt][1]}</option> {/section} </select> </td> I've read that I can change name="job_type" to name="job_type[]", but I'm not getting any luck with that... Link to comment https://forums.phpfreaks.com/topic/221155-multiple-select-listbox/ Share on other sites More sharing options...
requinix Posted December 9, 2010 Share Posted December 9, 2010 Name the field "job_type[]". Then $_POST["job_type"] will be an array. That is the right answer. So what did you try? Link to comment https://forums.phpfreaks.com/topic/221155-multiple-select-listbox/#findComment-1145137 Share on other sites More sharing options...
Buddski Posted December 10, 2010 Share Posted December 10, 2010 As previously stated, "jobtype[]" is required for the name. Can you show us your code that you are using to view the data once its been posted Link to comment https://forums.phpfreaks.com/topic/221155-multiple-select-listbox/#findComment-1145160 Share on other sites More sharing options...
nottoolate Posted December 10, 2010 Author Share Posted December 10, 2010 Thanks for the replies. I changed name to "job_type[]". This is what I had already included under my report parameters: if (isset($_POST['job_type'])){ $job_type = $_POST['job_type']; } else { $job_type= $_SESSION['report_job_type']; } When I attempt to run it I receive this error: Fatal error: Call to a member function RecordCount() on a non-object I checked my log file afterwards and I see 'oc18 error: 904: 0RA-00904: "ARRAY": invalid identifier. Link to comment https://forums.phpfreaks.com/topic/221155-multiple-select-listbox/#findComment-1145313 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.