Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Check whether the checkbox in a form is checked or not using javascript

848623Aug 2 2011 — edited Aug 3 2011
when we click a check box (TBD) it should set the value of a field to a default value '1234'. If we uncheck the checkbox, it should set the field as Null.
I have defined the checkbox as STATIC2:;1234 in form.

I used the onClick event on the checkbox and called a function to update the column.
Inside the function i am checking whether the check box is checked using
if (document.getElementById('P4_TBD').checked=true)
{
document.getElementById('P4_COL1).value='1234';
}
else
{
document.getElementById('P4_COL1).value=''; /* or $s("P4_COL1", "");

}

it works only when check box is checked. If check box is unchecked it is not setting the field as Null.
I checked document.getElementById('P4_TBD').checked=false instead of else clause. it is not working.
Please help me on this issue.

Thanks,
Ravi
This post has been answered by leinadjan on Aug 2 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 31 2011
Added on Aug 2 2011
4 comments
697 views