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!

Onclick Javascript To Call A PL/SQL Page Process That Populates a Field

664995Feb 24 2009 — edited Feb 26 2009
Hi All,

I have a report page with two date fields on one HTML region & links on the other HTML region. The requirement is such that when a user clicks on the first date field then that field should be populated with a first date on the database. Here's the process:

1. In the HTML Form Element Attributes for item: P3_START_DATE, I have placed:
onclick="javascript:first_Date('P3_START_DATE');"
2. The javascript to call a page process:
function first_Date(eItem)
 { 
  alert('Call Process . . . ');
  
  var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=Find_First_Date',0);
 
  alert('Process Called!');

  get.add(eItem,$x(eItem).value);

  alert('Value of First Date is: ' + $x(eItem).value);
 
  gReturn = get.get();

  eval(gReturn);
 
  get = null;
 }
3. PL/SQL Page Process:
BEGIN
select MIN(APPLICATION_DATE) into :P3_START_DATE FORM_DATA;
END;
What am I doing wrong here? By the way, the page process point is: On Submit - Before Computations & Validations. I changed the process point to: On Load - Before/After Header & the field was loaded when the page loaded which is not what I want. Any suggestions?

Regards
Kamo
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 26 2009
Added on Feb 24 2009
8 comments
1,585 views