0
<form action="..." method="post">
<input type="submit" name="btn_add" id="add" ...> 
...

I've jquery connected to this button:

$().ready(function() {  
    $('#add').click(function() {  
      ...;  
    });        
});  

Also, I want to

if(isset($_POST['btn_add'])){
... do something, doesnt work
 }

isset is not working. Is there any reason to that, because of jquery? If so, how can I have jquery working and isset listening to the same button?

Poo123
  • 49
  • 1
  • 1
  • 9
  • 2
    jquery is a client-side language. you can't access php variables ($_POST) through it. – Cruiser Feb 06 '17 at 14:19
  • `http://stackoverflow.com/questions/4231789/is-there-something-like-isset-of-php-in-javascript-jquery` – Ameya Deshpande Feb 06 '17 at 14:20
  • `$(document).ready(function() ` or `$(function(){ // code goes here });` – Kevorkian Feb 06 '17 at 14:21
  • It is not very clear - is your php in your php file (and not in your js) if so, then what does your jquery click function do? does it prevent the default action and do some sort of ajax? If so then perhaps the ajax is pointing at a different file or not passing the button variable or doing a get? So many possibilities, not enough information in your question – Pete Feb 06 '17 at 14:24
  • Do want to check if inputs with those names are filled or not? Like a validation thing! – ibrahim mahrir Feb 06 '17 at 14:35
  • JS and input code is in html. if isset is in view file. Before jquery was attached to that button, it worked fine. After I connected it with button, it doesn't work anymore. – Poo123 Feb 06 '17 at 14:55

1 Answers1

-1

set max_input_vars = 10000 in php.ini

ted
  • 13,596
  • 9
  • 65
  • 107