Tabluar form hide/show items on page load
HI all,
Apex 4.1
I'm using JS to show or hide fields, based on values of other fields, this in a tabular form. So this is used as a work around since dynamic actions are not able to do this out of the box on tabular forms (as far as I know).
The code I'm using is something like this :
In the page header :
function test(pThis) {
//get the curren row index on change
var currIndex = $('select[name="'+pThis.name+'"]').index($x(pThis.id));
if (pThis.value<0) {
$('input[name="f06"]')[currIndex].style.display = 'block';
}
else {
$('input[name="f06"]')[currIndex].style.display = 'none';
}
}
In the element attributes of the "source" column
onchange="javascript:test(this);"
This only fires when the source column is changed, but does not work when you initially load the page when it is populated with already stored records. So it only works when a field is actually changed by hand.
How can I force this action to be fired on on page load so the rule (hide-show fields) also gets applied to existing records ?
Regards
Bas