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
  • 626
  • 12
  • 27
0
onclick='if(this.checked) this.form.submit();'

Just remove the test to see if the checkbox is checked

onclick='this.form.submit();'
Quentin
  • 857,932
  • 118
  • 1,152
  • 1,264