reportingbuzz
MIS
Hi,
Not sure if I have to post this question here.
I have an admin page which has a textbox followed by a submit button and a horizontal rule - <HR>. On load of the page, this is all the admin users see. Only after the submit button is clicked, then the users get to see the Employee_Report.asp below the <HR>.
Within the Employee_report.asp is a form which has 4 hidden input boxes and other visible controls.
My Javascript looks into the hidden textboxes to maintain the state of the browser.
So when I load the page as an admin user, since the button is not yet clicked and Employee_report.asp is not yet included, my Javascript errs with regards to the hidden boxes with the message
So within the Javascript, is there a way to conditionally call the function below only when employee_report.asp is displayed.
Hope I did not confuse you.
Thanks.
Not sure if I have to post this question here.
I have an admin page which has a textbox followed by a submit button and a horizontal rule - <HR>. On load of the page, this is all the admin users see. Only after the submit button is clicked, then the users get to see the Employee_Report.asp below the <HR>.
Within the Employee_report.asp is a form which has 4 hidden input boxes and other visible controls.
My Javascript looks into the hidden textboxes to maintain the state of the browser.
So when I load the page as an admin user, since the button is not yet clicked and Employee_report.asp is not yet included, my Javascript errs with regards to the hidden boxes with the message
Code:
document.commission.hState.Value is either null or not an object
So within the Javascript, is there a way to conditionally call the function below only when employee_report.asp is displayed.
Code:
function do_onload()
{
//Enact the client behavior by extracting the contents of the hState
//and expanding back again so that the last selected employee is focused.
openedItems = document.commission.hState.value
if (openedItems != "")
{
//alert('Here b4 ' + openedItems + "'");
var displayItems = openedItems.split("&");
for (i=0; i<displayItems.length; i++)
{
if(displayItems[i].length != 0)
{
//Set the value to 'block'
//alert(displayItems[i]);
elID = 'UI_'+displayItems[i];
obj = document.getElementById(elID).style;
obj.display = 'block'
}
}
}
//Remember the last report clicked on. On load of the page, no value exists
openedCrystalItem = document.commission.hCrystalRadio.value
if (openedCrystalItem != "")
{
//alert(openedCrystalItem);
for(i=0;i<document.commission.crystalradio.length;i++) {
if (document.commission.crystalradio[i].value == openedCrystalItem) {
document.commission.crystalradio[i].checked = true;
}
}
}
//Remember the last date clicked on. On load of the page, no value exists.
openedDateItem = document.commission.hPeriod.value
//alert(openedDateItem);
for(i=0;i<document.commission.period.options.length;i++) {
if (document.commission.period.options[i].value == openedDateItem) {
document.commission.period.selectedIndex = i;
}
}
}
Hope I did not confuse you.
Thanks.