Jump to content

Multiple select listbox


nottoolate

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.