Forums

How to use selected rows

webcrea 07 Nov, 2016
Hi,
I would want use the selected rows in front list in a php script.

ex : In the front list, I check 3 cases (_SELECTOR_)
I click on button named "TASK"
the button send a submit.admin_form, it's ok
and I would want to use it in my script

Where can i retreive the gcb[], in fact the selection i did, please ?

thanks
GreyHead 07 Nov, 2016
Hi Christophe,

Is it in the URL? If so then ChronoForms will add it to the $form->data array

Bob
webcrea 07 Nov, 2016
hi Bob

it's generated by _SELECTOR_

each row have one checkbox and my question is how to use it ?

I'm affraid as my question is so simple!
webcrea 07 Nov, 2016
to solves this issue

add a hidden input and a script
<input type="hidden" id="list_gcb" name="list_gcb">

<script type="text/javascript">
jQuery(document).ready(function($){
	
	jQuery(".gc_selector").on("change", function(){

		var tbrows = new Array();
		jQuery(".gc_selector:checked").each(function(){
			v = this.getAttribute("value");
			tbrows.push(v);
		});
		listrows = tbrows.join(',');
		jQuery("#list_gcb").val(listrows);

	});
});
</script>

and you can retrieve your selected list in $_POST['list_gcb']
This topic is locked and no more replies can be posted.