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!

Tabluar form hide/show items on page load

Bas de KlerkJun 10 2012 — edited Jun 11 2012
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
This post has been answered by VC on Jun 11 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 9 2012
Added on Jun 10 2012
8 comments
609 views