I have the following code:
<script>
Sys.Application.add_load(FormLoad)
function
FormLoad()
{
HideOpportunity(
true
);
}
function
HideOpportunity(sender, eventArgs) {
var
x = document.getElementById(
"OpportunitySetUp"
);
if
(x.style.display ===
"none"
) {
x.style.display =
"block"
;
}
else
{
x.style.display =
"none"
;
}
var
ForecastingGrid = document.getElementById(
"ForecastingRevenue"
);
ForecastingGrid.style.display =
"none"
;
var
RevenueForecasting = $sq(
"[id$='cboRevenueForecasting']"
).val();
if
(RevenueForecasting ==
"Manual Phasing"
) {
ForecastingGrid.style.display =
"block"
;
}
else
{
ForecastingGrid.style.display =
"none"
;
}
}
</script>
When the form loads, the code works, everything is hidden. When i click on the "Opportunity Set Up" the first block shows.
Then within this "Opportunity Set Up" there's a comboBox, and if the value "Manual Phasing" is selected, the 2nd section "ForecastingGrid" shows.
This seems to work perfectly up until the combobox value is selected. The code only seems to execute and show the "ForcastingRevenue" section when "autopostback = true" is added to the combobox properties but this is useless as it refreshes the page of the form, resetting the other .style.display element of "OpportunitySetUp".
Is there a way to have the form load without adding in the autopostback property? I'm using the Cora Sequence framework if that is any use.
Thanks for any help!