0

I submit a form by checking a checkbox like this:

<input type=checkbox name=catIds[] id=cat".$row['id']." value=".$row['id']."  onclick='if(this.checked) this.form.submit();' checked>

But now I need to submit also the form by setting the box unchecked. Is this possible?

Thank you.

tomseno1
  • 9
  • 4

2 Answers2

0

Just on click submit form

<input type=checkbox name=catIds[] id=cat".$row['id']." value=".$row['id']."  onclick='this.form.submit();' checked>
Shree29
  • 634
  • 11
  • 29
0
onclick='if(this.checked) this.form.submit();'

Just remove the test to see if the checkbox is checked

onclick='this.form.submit();'
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335