Jump to content

Return Multiple Values from picklist using $_REQUEST


jlam1021

Recommended Posts

So I have an existing picklist that i am trying to tweak - I am making it into a multiselect and trying to return multiple values

I have been able to accomplish the first part by adding select 'multiple' but when i submit it only returns results for the last value selected.

 

Here is the code for the form (Left out the picklists that do not need to be multiple select)

 

<td align="center" valign="top">
<? // base64_encode(base64_encode( 'test1'))?>
<br />
<br />
<form id='report_form' action="driverreport_sd.php" method="post" name="report_form">
<!--<div class="criteria_div">-->
<table align="center" class="table_border" cellpadding="5" cellspacing="0" width="80%">
<tr>
<td align="right" class="first_td">
Status:
</td>
<td align="left">
<select multiple name='Status' id='Status'>

<? $statuslist=$ObjReport->ObjStatus->get_Status_List(); while($status=mysql_fetch_object($statuslist)) { if($status->Status=="Please Select") { ?>

<option value="<?=$status->Status?>" <?=($status->Status==$_REQUEST['Status']?"selected=selected":"")?>>
<?=$status->Status?></option>
<? } else { ?>
<option value="<?=$status->Status?>" <?=($status->Status==$_REQUEST['Status']?"selected=selected":"")?>>
<?=$status->Status?></option>
<? } } ?>
</select>
</td>
</tr>


<td align="center" colspan="2">
<input type="hidden" id='sort_by' name='sort_by' value="<?=$_REQUEST['sort_by']?>" />
<input type="hidden" name='search_val' id='search_val' value="
<?=$_REQUEST['search_val']?>" />
<input type="hidden" name='search_by' id='search_by' value="
<?=$_REQUEST['search_by']?>" />
<input type="hidden" name="report_submited" value='report_submited' />
<button type="submit" id="report_submited" name="" value='submit'>Submit</button>
</td>

 

and here is the return request

 

                <?    
                    if($_REQUEST['report_submited'])    
                    {
                        
                        
                    
                        
                    
                        $ReportData=$ObjReport->generate_report($_REQUEST['Status'],$_REQUEST['School'],$_REQUEST['Campaign'],$_REQUEST['State'],$_REQUEST['Stdtype'],$_REQUEST['Primbad'],$_REQUEST['Rep'],$_REQUEST['From_Date'],$_REQUEST['To_Date'],$_REQUEST['sort_by'],$_REQUEST['search_by'],$_REQUEST['search_val']);
                        $currentTotalRow=mysql_num_rows($ReportData);
                        if($currentTotalRow>0)
                        {
                        
                ?>

 

Any suggestions would be appreciated

Thanks!

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.