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!

Populate date field with current date when checkbox selected

mterleskyDec 4 2008 — edited Dec 8 2008
Hi,

I have a checkbox with a related date field in a form and want to populate the date field with the current date only when the checkbox is selected. The checkbox uses a static LOV of Yes,No values.

I have this in the HTML Form Element Attributes of the Checkbox item:

onChange="javascript:addthis();"


I have this in the HTML Header for the page:

function addthis(){
var val1 = ($v('P21_CHECKBOX'));

if ($v('P21_CHECKBOX') = "Yes"){
var answer = to_date(sysdate)
$s('P21_DATE',answer);
}
}


It is not populating the date. Any suggestions are greatly appreciated.

Thanks,
Matt
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 5 2009
Added on Dec 4 2008
9 comments
866 views