Identify the checkbox that is checked

Posted by lucky on Stack Overflow See other posts from Stack Overflow or by lucky
Published on 2010-06-01T14:57:31Z Indexed on 2010/06/01 15:23 UTC
Read the original article Hit count: 250

Filed under:
|

Hello Everyone,

I have 2 checkboxes in a form and onclick of these, some php code needs to be executed and based on the result of the code, the checkbox is checked or unchecked.

So i have written onclick = document.formName.submit(); Now it is triggering the same page and i am able to write the code. I am not able to differentiate which checkbox is checked.

I don't want to use the procedure of:- calling javascript and then storing the value of the checkbox in a variable and making this variable as invisible.

I would like to write something like document.formName.submit('checkbox1'). So that i should be able to handle the value of this or i dont know.

Please suggest me an alternative method or better approach.

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript