APEX submit changes to database when value is changed Javascript?
1009117May 15 2013 — edited May 15 2013Hi,
Im new to Apex and am using v4.1.
What I want to do is have a tabular form that will have 5 entry fields and a number of read only fields based on a SQL table & View, when a user updates one of the 5 entry fields I want to save the change to the databases automatically.
I was thinking this could be done using Ajax and Javascript however my knowledge is not at a high enough level to get this to work.
I think what I need to do:
1. Create an AJAX Callback process (lets say its called "Submit Changes") - This will be PL SQL that will update the database based on the field value that has been changed. I think this will require the tabular form row number to be passed into it.
2. Create a HTML Header with the Javascript that calls the AJAX Callback process - I found the below on the net but don't think I have altered it correctly:
<script type="text/javascript">
function Submit_Value(){
var ajaxRequest=new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=Submit Changes',0);
var ajaxResult=ajaxRequest.get();
alert(ajaxResult);
}
</script>
3. Edit the "Element Attributes" on the Report column to something like onchange="Submit_Value()";
So far I have not been able to get this working and would appreciate any help or suggestions.
Thanks
Naill