Skip to content
Advertisement

variable is not passing from javascript to php through ajax

i have a code that should pass the value of all checked list to a php file , so as to delete the rows of a csv file . so the check box value is dynamic

JavaScript

and i have to get all the value of checked checkbox , so i used javascript and this javascript will pass the value to PHP through ajax

JavaScript

so it has to pass the value to same page (Index.php) and PHP code is’

JavaScript

but it is not posting the value . till Javascript code everything works fine ( i did an alert to check the data is fetched or not ) but the value is not getting posted in PHP ,

Advertisement

Answer

I think the issue was with the checkboxes set. Nonetheless, its working now. All the values being checked are passes properly and can be checked by uncommenting the lines in php code.

HTML:

JavaScript

PHP Code:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement