E
E
exedis2015-09-21 19:21:06
PHP
exedis, 2015-09-21 19:21:06

How to correctly send a click through load?

Hello, the following is loaded from the database:
if($row['active']=='0'){$table .= "\n";}
else{$table .= "\n";}
and there is a script that sends a click buttons to the form
$(document).ready(function(){
$("#off").click(function(){
$("#status").load("save.php","valid="+$ ("#off").val());
})
});
But for some reason only the first button on the list works, the rest are ignored. Why is that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Ineshin, 2015-09-21
@exedis

#off and #status are IDs. They must be unique. Therefore, if you have several identical IDs on the page, then JS will only accept the first of them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question