selectivity icon indicating copy to clipboard operation
selectivity copied to clipboard

Removed items being passed on POST

Open orthodoxws opened this issue 7 years ago • 6 comments

Items selected, then unselected are still being passed with the form data:

https://www.screencast.com/t/oVtooqGwl3k

orthodoxws avatar Jun 01 '17 22:06 orthodoxws

Sorry, I don't have Flash installed here, can you describe the issue in some other way?

arendjr avatar Jul 21 '17 08:07 arendjr

Ah, I'm sorry! Here it is as an MP4: https://www.screencast.com/t/feWNGeWir

orthodoxws avatar Jul 21 '17 15:07 orthodoxws

Thanks! I suppose you're using the jQuery build, right? Can you show me the code you use for initializing Selectivity? Am I understanding correctly it is only removing that's causing an issue, right?

arendjr avatar Jul 24 '17 07:07 arendjr

Yes, I'm using the jQuery build. The problem is that when I remove a directory which I had formerly checked, it still submits in the POST data. Thanks for your help with this!

Here's the code:

$(".selectivity").selectivity( { backspaceHighlightsBeforeDelete: true } );

Then..

													<select id="cb" name="cb[]" multiple class="selectivity">
														<?
														
													  for ($s = 0; $s < $snum_results; $s++)
													  {
													     echo "<option value=\"$srow[dir]\" ";
													     if (in_array($srow[dir], $dir_arr))
													         echo "selected";
													     echo "> $srow[dir]</option>";
													     $srow = mysqli_fetch_array($sresult);
													  }															
																																																															 
														?>   
													</select>

orthodoxws avatar Jul 25 '17 00:07 orthodoxws

Thanks for that code sample! I think what is going wrong is that the selected options you generate in your markup are still being sent when you submit the form. I can agree that's a bug that should be handled by Selectivity, but I have to think how I can easily solve that. Will keep you posted! On Tue, 25 Jul 2017 at 02:35 orthodoxws [email protected] wrote:

Yes, I'm using the jQuery build. The problem is that when I remove a directory which I had formerly checked, it still submits in the POST data. Thanks for your help with this!

Here's the code:

$(".selectivity").selectivity( { backspaceHighlightsBeforeDelete: true } );

Then..

  											<select id="cb" name="cb[]" multiple class="selectivity">
  												<?
  												
  											  for ($s = 0; $s < $snum_results; $s++)
  											  {
  											     echo "<option value=\"$srow[dir]\" ";
  											     if (in_array($srow[dir], $dir_arr))
  											         echo "selected";
  											     echo "> $srow[dir]</option>";
  											     $srow = mysqli_fetch_array($sresult);
  											  }															
  																																																													
  												?>
  											</select>

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/arendjr/selectivity/issues/196#issuecomment-317593909, or mute the thread https://github.com/notifications/unsubscribe-auth/AAgjLgTPpEfaXVZ0WmQaUiU95N4reKNFks5sRThFgaJpZM4NtmmC .

arendjr avatar Jul 26 '17 17:07 arendjr

Thank you very much! I appreciate it!

orthodoxws avatar Jul 26 '17 18:07 orthodoxws