on 02-09-2005 4:19 PM
Hi All,
Imagine the following scenario:
A BSP form is loaded with pre-populated form elements (i.e. some of the text fields are pre-populated from back-end using onInitialization event).
A user changes the content of HTML form (i.e. enters some new values in text fields) and hits the save button. onInputProcessing event is triggered.
What I am trying to accomplish is to get two sets of data using REQUEST->GET_FORM_DATA method.
1) When the form loads (but before user has a chance to change form content).
2) When the form is submitted with new values.
The reason is that I want to compare each data set (initial and modified) to create a "log" of what fields have been changed.
Did anyone ever face a similar task? Thanks in advance for all help.
Regards,
Roman D.
Hallo Roman,
There is one idea, which I have seen CRM colleagues do. But this is for browser. You should do some reading up of the "defaultValue" attribute on input fields from some website on HTML dom. What this script does is find all input fields, and see which value is not the way it was before.
function htmlbSubmitPre(){
var formID=document.getElementById("myFormId");
var allInp=formID.getElementsByTagName('INPUT');
for(var i=0;i<allInp.length;i++){
if(allInp<i>.type=='text' {
if(allInp<i>.value==allInp<i>.defaultValue){
...
}
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the oninitialization event move the current values to some hidden form field and in oninputprocessing read the hidden field values and the user entered values from the input fields using REQUEST->GET_FORM_DATA .
Regards
Raja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is no standard way to get "old" and "new" values, as there is always only the "new" value submitted by the form.
Placing the "old" values into hidden form fields sure works, but is just creating an overhead in the amount of form elements, so you might be better off placing these "old" values on the server-side, either application class, model, server-side-cookie, ...
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.