Solved

document.getElementById(DivId).innerHTML = AJAX.responseText

Posted on 2009-05-15
8
1,663 Views
Last Modified: 2012-05-07
I am trying to buid a preloader for an ASP page.The submit button on the asp page has on the onclick event a function which is called the function is :
<script>
function ajaxRequest(url,DivId)
{
var AJAX;
try
{
AJAX = new XMLHttpRequest();
}
catch(e)
{
try
{
AJAX = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
AJAX = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
alert("Your browser does not support AJAX.");
return false;
}
}
}
AJAX.onreadystatechange = function()
{
if(AJAX.readyState == 4)
{
if(AJAX.status == 200)
{
document.getElementById(DivId).innerHTML = AJAX.responseText;
}
else
{
alert("Error: "+ AJAX.statusText +" "+ AJAX.status);
}
hideLoadingPanel();
}
else
{
displayLoadingPanel();
}
}
AJAX.open("get", "Sub_Report_Packing_Lines.asp", true);
AJAX.send(null);
}
</script>

When I click the button the preloader gif loads but it freezez then windows comes up with an error saying  error:'document.getElementById(  ).Null or not an object.If I click on the error window saying I don't want to debug the gif stays up in a "freezed" state untill the page loads.then the other asp page I called with the submit button loads all right.The amount of time the preloader stays on is perfect as if I buid a query from the original page which will go through a small amount of data preloader stay on for short time.If the amount of data  is larger than the preloader stay on for longer accordingly.
This shows me that the code is working all right at some sort of level but I don't understand why I get the div error.What is that div used for anyway to show the output of the function?
If yes do I have to define it and if yes where?Please help I am so close .
This is the whole html part of the asp page where the button is 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="content-type" content="text/html; charset=windows-1252">

<title>Start_Report</title>

<script>

function ajaxRequest(url,DivId)

{

var AJAX;

try

{

AJAX = new XMLHttpRequest();

}

catch(e)

{

try

{

AJAX = new ActiveXObject("Msxml2.XMLHTTP");

}

catch(e)

{

try

{

AJAX = new ActiveXObject("Microsoft.XMLHTTP");

}

catch(e)

{

alert("Your browser does not support AJAX.");

return false;

}

}

}

AJAX.onreadystatechange = function()

{

if(AJAX.readyState == 4)

{

if(AJAX.status == 200)

{

document.getElementById(DivId).innerHTML = AJAX.responseText;

}

else

{

alert("Error: "+ AJAX.statusText +" "+ AJAX.status);

}

hideLoadingPanel();

}

else

{

displayLoadingPanel();

}

}

AJAX.open("get", "Sub_Report_Packing_Lines.asp", true);

AJAX.send(null);

}

</script>

<meta http-equiv="Page-Exit" content="progid:DXImageTransform.Microsoft.Fade(duration=.5)">

<script src="Scripts/RoundedCornersPanel/RoundedCornersPanel.js" type="text/javascript"></script>

<script src="Scripts/Web20AJAXLoadingPanel/Scripts/Web20AJAXLoadingPanel.js" type="text/javascript"></script>

<meta content="CodeCharge Studio 3.2.0.4" name="GENERATOR">

<script language="JavaScript" type="text/javascript">
 

//Begin CCS script

//Include Common JSFunctions @1-5C08C693

</script>

<script language="JavaScript" src="ClientI18N.asp?file=Functions.js&amp;locale={res:CCS_LocaleID}" type="text/javascript" charset="utf-8"></script>

<script language="JavaScript" src="ClientI18N.asp?file=DatePicker.js&amp;locale={res:CCS_LocaleID}" type="text/javascript" charset="utf-8"></script>

<script language="JavaScript" type="text/javascript">

//End Include Common JSFunctions
 

//Include User Scripts @1-5EED8E1E

</script>

<script language="JavaScript" src="js/menu/ADxMenu.js" type="text/javascript"></script>

<link href="Styles/adx.css" type="text/css" rel="stylesheet">

<link href="Styles/Flamenco1/Menu.css" type="text/css" rel="stylesheet">

<script language="JavaScript" type="text/javascript">

//End Include User Scripts
 

//Date Picker Object Definitions @1-179FCDD0
 

var Grid2_DatePicker_s_Start_Start1 = new Object(); 

Grid2_DatePicker_s_Start_Start1.format           = "yyyy/mm/dd hh:nn:ss";

Grid2_DatePicker_s_Start_Start1.style            = "Styles/Flamenco1/Style.css";

Grid2_DatePicker_s_Start_Start1.relativePathPart = "";

Grid2_DatePicker_s_Start_Start1.themeVersion = "3.0";
 

var Grid2_DatePicker_s_Start_Stop1 = new Object(); 

Grid2_DatePicker_s_Start_Stop1.format           = "yyyy/mm/dd hh:nn:ss";

Grid2_DatePicker_s_Start_Stop1.style            = "Styles/Flamenco1/Style.css";

Grid2_DatePicker_s_Start_Stop1.relativePathPart = "";

Grid2_DatePicker_s_Start_Stop1.themeVersion = "3.0";
 

//End Date Picker Object Definitions
 

//_OnLoad @1-2F43613D
 

function _OnLoad()

{

    var result;

//End _OnLoad
 

//Close _OnLoad @1-BC33A33A

    return result;

}

//End Close _OnLoad
 

//bind_events @1-C6C5CA6C

function bind_events() {

    addEventHandler("Menu1Container", "load", load_ADxMenu);

    addEventHandler("", "load", _OnLoad);

}

//End bind_events
 

window.onload = bind_events; //Assign bind_events @1-19F7B649
 

//End CCS script

</script>

<!--[if IE 6]><link rel="stylesheet" type="text/css" href="Styles/{CCS_Style}/Style_ie6.css"><![endif]-->

<!--[if IE 6]><link rel="stylesheet" type="text/css" href="Styles/{CCS_Style}/Style_Components_ie6.css"><![endif]-->

<link media="screen, tv, projection" href="Styles/adx.css" type="text/css" rel="stylesheet">

<script src="js/menu/ADxMenu.js" type="text/javascript"></script>

<link media="screen, tv, projection" href="Styles/Flamenco1/Menu.css" type="text/css" rel="stylesheet">

<link href="Styles/Flamenco1/Style_doctype.css" type="text/css" rel="stylesheet">

</head>

<body id="DivId">

&nbsp;&nbsp;&nbsp; 

<div id="DivId">

</div>

<table align="left" border="0">

  <tr>

    <td>

      <!-- BEGIN Menu Menu1 -->

      <div class="MenuStyle" id="Menu1Container">

        <ul class="adxm {Menu1:MenuType} level1">

          <!-- BEGIN Item -->

          <!-- BEGIN OpenLevel -->

          <ul class="level{Menu1:Item_Level}">

            <!-- END OpenLevel -->

            <li {Menu1:DefaultItem}><a href="{ItemLink_Src}" class="{Menu1:Submenu}" target="{Menu1:Target}" title="{Menu1:Title}">{ItemLink}</a> 

            <!-- BEGIN CloseItem --></li>

 <!-- END CloseItem -->

            <!-- BEGIN CloseLevel -->

          </ul>

 </li>

 <!-- END CloseLevel --><!-- END Item -->

        </ul>

 

      </div>

      <!-- END Menu Menu1 --></td>

  </tr>

</table>

<p>&nbsp;</p>

<p>

<hr style="COLOR: #ff6600" size="2">

<p></p>

<table align="center" border="0">

  <tr>

    <td>&nbsp;</td> 

    <td>

      <!-- BEGIN Record Grid2 -->

      <form name="{HTMLFormName}" action="{Action}" method="post">

        <h2>Generate Report&nbsp;All Lines</h2>

 

        <table>

          <!-- BEGIN Error -->

          <tr>

            <td colspan="2">{Error}</td>

          </tr>

          <!-- END Error -->

          <tr>

            <td><label for="Grid2s_Start_Start">StartDate:</label></td> 

            <td><input id="Grid2s_Start_Start" style="WIDTH: 168px; HEIGHT: 22px" maxlength="100" size="18" value="{s_Start_Start}" name="{s_Start_Start_Name}">

              <!-- BEGIN DatePicker DatePicker_s_Start_Start1 --><a href="javascript:showDatePicker('{Name}','{FormName}','{DateControl}');" id="Grid2DatePicker_s_Start_Start1"><img id="Grid2DatePicker_s_Start_Start1_Image" alt="Show Date Picker" src="Styles/Flamenco1/Images/DatePicker.gif" border="0"></a>&nbsp;&nbsp;<!-- END DatePicker DatePicker_s_Start_Start1 --></td>

          </tr>

 

          <tr>

            <td>Stop Date:</td> 

            <td><input id="Grid2s_Start_Stop" style="WIDTH: 168px; HEIGHT: 22px" size="22" value="{s_Start_Stop}" name="{s_Start_Stop_Name}">

              <!-- BEGIN DatePicker DatePicker_s_Start_Stop1 --><a href="javascript:showDatePicker('{Name}','{FormName}','{DateControl}');" id="Grid2DatePicker_s_Start_Stop1"><img id="Grid2DatePicker_s_Start_Stop1_Image" alt="Show Date Picker" src="Styles/Flamenco1/Images/DatePicker.gif" border="0"></a>&nbsp;&nbsp;<!-- END DatePicker DatePicker_s_Start_Stop1 --></td>

          </tr>

 

          <tr>

            <td><label for="Grid2Grid2Order">Sort by</label></td> 

            <td>

              <select id="Grid2Grid2Order" name="Grid2Order">

                {Grid2Order_Options}

              </select>

 <label for="Grid2Grid2Dir" style="display: none;">{res:CCS_SortDir}</label> 

              <select id="Grid2Grid2Dir" name="Grid2Dir">

                {Grid2Dir_Options}

              </select>

 </td>

          </tr>

 

          <tr>

            <td><label for="Grid2Grid2PageSize">Records per page</label></td> 

            <td>

              <select id="Grid2Grid2PageSize" name="{Grid2PageSize_Name}">

                {Grid2PageSize_Options}

              </select>

 </td>

          </tr>

 

          <tr>

            <td align="right" colspan="2">

              <!-- BEGIN Button Button_DoSearch --><input id="Grid2Button_DoSearch" onclick="ajaxRequest()" type="submit" alt="Search" value="Search" name="{Button_Name}"><!-- END Button Button_DoSearch --></td>

          </tr>

        </table>

      </form>

      &nbsp;&nbsp;<!-- END Record Grid2 -->&nbsp;&nbsp;</td>

  </tr>

</table>

<br>

<hr style="COLOR: #ff6600" size="2">

</body>

</html>

Open in new window

0
Comment
Question by:Latzi_Marian
  • 4
  • 4
8 Comments
 
LVL 20

Expert Comment

by:ddayx10
ID: 24400757
It doesn't appear you are sending in the proper parameters for your function

function ajaxRequest(url,DivId)

onclick="ajaxRequest()

When the function tries to call document.getElementById() it returns Null:
document.getElementById(DivId).innerHTML = AJAX.responseText;

I dont know what div you want to post to or the url you are requestion from but if you supply those parameters I think it might work.

dday
0
 

Author Comment

by:Latzi_Marian
ID: 24401375
I don't really want to pass any parameter in between the pages.All I want is when I click the submit button to have the loading *..gif showing in the middle of the screen as it does now and when the submit button href is loaded make the *.gif dissapear and show the page which is finished loading.
As I said it's all working except I have the document.getElementById() it returns Null error and I have to push the do not debug button on the error popup to get it working.If I push the submit button the error message comes up let's say 1 second later I get rid of it but the gif will stay up untill the page is loaded then it will dissapear as it should .So that bit is ok.As I said this is not my league (Ajax & Javascript) so I don't really know what that div is all about .Why do I need it in the first place?
0
 
LVL 20

Expert Comment

by:ddayx10
ID: 24401529
Check out lines 38-40 in your code snippet.

status == 200 is going to indicate a successful response. It wants to place the returned response into a div. This div is selected on line 40. Since you have a div with id="DivId" on the page you can change the javascript to try to place the ajax response there. You were pretty close just needing to add quotes on the line:

document.getElementById('DivId').innerHTML = AJAX.responseText;

This should get rid of the Null Error.

I'm sorry I thought from the complexity of the code, and the way you phrased your question that you would be able to have success if I just found the bug and pointed it out to you. I hope this helps.

dday

0
 
LVL 20

Expert Comment

by:ddayx10
ID: 24401546
PS:

lines 125-127:
<body id="DivId">
&nbsp;&nbsp;&nbsp;
<div id="DivId">

Both your body and the div here have the same ID. This will cause an error as well. Pick the location you would like the ajax response to be placed into and keep the id="DivId" there. Any other elements on the page that have this id need to have their id changed to something unique.

dday
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 20

Accepted Solution

by:
ddayx10 earned 500 total points
ID: 24401578
I've made the changes I mentioned and posted the code below for you.

I would like to change line 8 << function ajaxRequest(url,DivId)  >> to read:
function ajaxRequest()
but I dont dare because I dont know if any of your other resources are going to call it. It should be fine though.

There is no way I can run this code, or even seriously debug it because it is so dependent on other resources. The best I can do is answer your original questions and hope you are as close as you think you are.

****Original Questions*** <<Answered (with updated code) >>
What is that div used for anyway to show the output of the function?
If yes do I have to define it and if yes where?
*****************************

good luck, I'm gone for the weekend.

dday




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="content-type" content="text/html; charset=windows-1252">

<title>Start_Report</title>

<script>

function ajaxRequest(url,DivId)

{

var AJAX;

try

{

AJAX = new XMLHttpRequest();

}

catch(e)

{

try

{

AJAX = new ActiveXObject("Msxml2.XMLHTTP");

}

catch(e)

{

try

{

AJAX = new ActiveXObject("Microsoft.XMLHTTP");

}

catch(e)

{

alert("Your browser does not support AJAX.");

return false;

}

}

}

AJAX.onreadystatechange = function()

{

if(AJAX.readyState == 4)

{

if(AJAX.status == 200)

{

document.getElementById('DivId').innerHTML = AJAX.responseText;

}

else

{

alert("Error: "+ AJAX.statusText +" "+ AJAX.status);

}

hideLoadingPanel();

}

else

{

displayLoadingPanel();

}

}

AJAX.open("get", "Sub_Report_Packing_Lines.asp", true);

AJAX.send(null);

}

</script>

<meta http-equiv="Page-Exit" content="progid:DXImageTransform.Microsoft.Fade(duration=.5)">

<script src="Scripts/RoundedCornersPanel/RoundedCornersPanel.js" type="text/javascript"></script>

<script src="Scripts/Web20AJAXLoadingPanel/Scripts/Web20AJAXLoadingPanel.js" type="text/javascript"></script>

<meta content="CodeCharge Studio 3.2.0.4" name="GENERATOR">

<script language="JavaScript" type="text/javascript">

 

//Begin CCS script

//Include Common JSFunctions @1-5C08C693

</script>

<script language="JavaScript" src="ClientI18N.asp?file=Functions.js&amp;locale={res:CCS_LocaleID}" type="text/javascript" charset="utf-8"></script>

<script language="JavaScript" src="ClientI18N.asp?file=DatePicker.js&amp;locale={res:CCS_LocaleID}" type="text/javascript" charset="utf-8"></script>

<script language="JavaScript" type="text/javascript">

//End Include Common JSFunctions

 

//Include User Scripts @1-5EED8E1E

</script>

<script language="JavaScript" src="js/menu/ADxMenu.js" type="text/javascript"></script>

<link href="Styles/adx.css" type="text/css" rel="stylesheet">

<link href="Styles/Flamenco1/Menu.css" type="text/css" rel="stylesheet">

<script language="JavaScript" type="text/javascript">

//End Include User Scripts

 

//Date Picker Object Definitions @1-179FCDD0

 

var Grid2_DatePicker_s_Start_Start1 = new Object(); 

Grid2_DatePicker_s_Start_Start1.format           = "yyyy/mm/dd hh:nn:ss";

Grid2_DatePicker_s_Start_Start1.style            = "Styles/Flamenco1/Style.css";

Grid2_DatePicker_s_Start_Start1.relativePathPart = "";

Grid2_DatePicker_s_Start_Start1.themeVersion = "3.0";

 

var Grid2_DatePicker_s_Start_Stop1 = new Object(); 

Grid2_DatePicker_s_Start_Stop1.format           = "yyyy/mm/dd hh:nn:ss";

Grid2_DatePicker_s_Start_Stop1.style            = "Styles/Flamenco1/Style.css";

Grid2_DatePicker_s_Start_Stop1.relativePathPart = "";

Grid2_DatePicker_s_Start_Stop1.themeVersion = "3.0";

 

//End Date Picker Object Definitions

 

//_OnLoad @1-2F43613D

 

function _OnLoad()

{

    var result;

//End _OnLoad

 

//Close _OnLoad @1-BC33A33A

    return result;

}

//End Close _OnLoad

 

//bind_events @1-C6C5CA6C

function bind_events() {

    addEventHandler("Menu1Container", "load", load_ADxMenu);

    addEventHandler("", "load", _OnLoad);

}

//End bind_events

 

window.onload = bind_events; //Assign bind_events @1-19F7B649

 

//End CCS script

</script>

<!--[if IE 6]><link rel="stylesheet" type="text/css" href="Styles/{CCS_Style}/Style_ie6.css"><![endif]-->

<!--[if IE 6]><link rel="stylesheet" type="text/css" href="Styles/{CCS_Style}/Style_Components_ie6.css"><![endif]-->

<link media="screen, tv, projection" href="Styles/adx.css" type="text/css" rel="stylesheet">

<script src="js/menu/ADxMenu.js" type="text/javascript"></script>

<link media="screen, tv, projection" href="Styles/Flamenco1/Menu.css" type="text/css" rel="stylesheet">

<link href="Styles/Flamenco1/Style_doctype.css" type="text/css" rel="stylesheet">

</head>

<body id="BodyId">

&nbsp;&nbsp;&nbsp; 

<div id="DivId">

</div>

<table align="left" border="0">

  <tr>

    <td>

      <!-- BEGIN Menu Menu1 -->

      <div class="MenuStyle" id="Menu1Container">

        <ul class="adxm {Menu1:MenuType} level1">

          <!-- BEGIN Item -->

          <!-- BEGIN OpenLevel -->

          <ul class="level{Menu1:Item_Level}">

            <!-- END OpenLevel -->

            <li {Menu1:DefaultItem}><a href="{ItemLink_Src}" class="{Menu1:Submenu}" target="{Menu1:Target}" title="{Menu1:Title}">{ItemLink}</a> 

            <!-- BEGIN CloseItem --></li>

 <!-- END CloseItem -->

            <!-- BEGIN CloseLevel -->

          </ul>

 </li>

 <!-- END CloseLevel --><!-- END Item -->

        </ul>

 

      </div>

      <!-- END Menu Menu1 --></td>

  </tr>

</table>

<p>&nbsp;</p>

<p>

<hr style="COLOR: #ff6600" size="2">

<p></p>

<table align="center" border="0">

  <tr>

    <td>&nbsp;</td> 

    <td>

      <!-- BEGIN Record Grid2 -->

      <form name="{HTMLFormName}" action="{Action}" method="post">

        <h2>Generate Report&nbsp;All Lines</h2>

 

        <table>

          <!-- BEGIN Error -->

          <tr>

            <td colspan="2">{Error}</td>

          </tr>

          <!-- END Error -->

          <tr>

            <td><label for="Grid2s_Start_Start">StartDate:</label></td> 

            <td><input id="Grid2s_Start_Start" style="WIDTH: 168px; HEIGHT: 22px" maxlength="100" size="18" value="{s_Start_Start}" name="{s_Start_Start_Name}">

              <!-- BEGIN DatePicker DatePicker_s_Start_Start1 --><a href="javascript:showDatePicker('{Name}','{FormName}','{DateControl}');" id="Grid2DatePicker_s_Start_Start1"><img id="Grid2DatePicker_s_Start_Start1_Image" alt="Show Date Picker" src="Styles/Flamenco1/Images/DatePicker.gif" border="0"></a>&nbsp;&nbsp;<!-- END DatePicker DatePicker_s_Start_Start1 --></td>

          </tr>

 

          <tr>

            <td>Stop Date:</td> 

            <td><input id="Grid2s_Start_Stop" style="WIDTH: 168px; HEIGHT: 22px" size="22" value="{s_Start_Stop}" name="{s_Start_Stop_Name}">

              <!-- BEGIN DatePicker DatePicker_s_Start_Stop1 --><a href="javascript:showDatePicker('{Name}','{FormName}','{DateControl}');" id="Grid2DatePicker_s_Start_Stop1"><img id="Grid2DatePicker_s_Start_Stop1_Image" alt="Show Date Picker" src="Styles/Flamenco1/Images/DatePicker.gif" border="0"></a>&nbsp;&nbsp;<!-- END DatePicker DatePicker_s_Start_Stop1 --></td>

          </tr>

 

          <tr>

            <td><label for="Grid2Grid2Order">Sort by</label></td> 

            <td>

              <select id="Grid2Grid2Order" name="Grid2Order">

                {Grid2Order_Options}

              </select>

 <label for="Grid2Grid2Dir" style="display: none;">{res:CCS_SortDir}</label> 

              <select id="Grid2Grid2Dir" name="Grid2Dir">

                {Grid2Dir_Options}

              </select>

 </td>

          </tr>

 

          <tr>

            <td><label for="Grid2Grid2PageSize">Records per page</label></td> 

            <td>

              <select id="Grid2Grid2PageSize" name="{Grid2PageSize_Name}">

                {Grid2PageSize_Options}

              </select>

 </td>

          </tr>

 

          <tr>

            <td align="right" colspan="2">

              <!-- BEGIN Button Button_DoSearch --><input id="Grid2Button_DoSearch" onclick="ajaxRequest()" type="submit" alt="Search" value="Search" name="{Button_Name}"><!-- END Button Button_DoSearch --></td>

          </tr>

        </table>

      </form>

      &nbsp;&nbsp;<!-- END Record Grid2 -->&nbsp;&nbsp;</td>

  </tr>

</table>

<br>

<hr style="COLOR: #ff6600" size="2">

</body>

</html>

Open in new window

0
 

Author Comment

by:Latzi_Marian
ID: 24406021
Hi,

I've got the code working by making line 46 from my code the same with line 50.So in other words I use only displayLoadingPanel().This is because the something strange happens when I call the asp page for the ajax code the state is ready when the grid from the result page comes up.But at that stage the grid is still empty.No data in it just the frame of the grid.so the empty grid shows up in the div but the panel is gone so the page shows an empty grid untill the data comes up but at that stage the stae changes again I suppose so I fixed this by using the dispalyLodingPanel() twice and I did hide the div as well by saying document.getElementById(DivId).style.display = "none"; .It works perfectly with Firefox and Opera but with IE and Safari the Ajax loading panel loads ok but the GIF ANIMATION DOESN'T PLAY!!!
This I knew from the very start that it won't be an easy job.I just don't know why IE doesn't play the .gif from the Ajax panel.
Firefox is perfect.I did upgrade ie to v 8 to v7 and still the same problem.
Have you got any ideea what to do next.Should I try to somehow "force" the gif to refresh or something with a Java fucntion?What do you think.I can leave it as it is as it's working but the Ajax panel shows a static image.It would be nicer to show the playing Gif.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="content-type" content="text/html; charset=windows-1252">

<title>Start_Report</title>

<meta http-equiv="Page-Exit" content="progid:DXImageTransform.Microsoft.Fade(duration=.5)">

<script src="Scripts/RoundedCornersPanel/RoundedCornersPanel.js" type="text/javascript"></script>

<script src="Scripts/Web20AJAXLoadingPanel/Scripts/Web20AJAXLoadingPanel.js" type="text/javascript"></script>

<meta content="CodeCharge Studio 3.2.0.4" name="GENERATOR">

<script language="JavaScript" type="text/javascript">
 

//Begin CCS script

//Include Common JSFunctions @1-5C08C693

</script>

<script language="JavaScript" src="ClientI18N.asp?file=Functions.js&amp;locale={res:CCS_LocaleID}" type="text/javascript" charset="utf-8"></script>

<script language="JavaScript" src="ClientI18N.asp?file=DatePicker.js&amp;locale={res:CCS_LocaleID}" type="text/javascript" charset="utf-8"></script>

<script language="JavaScript" type="text/javascript">

//End Include Common JSFunctions
 

//Include User Scripts @1-5EED8E1E

</script>

<script language="JavaScript" src="js/menu/ADxMenu.js" type="text/javascript"></script>

<link href="Styles/adx.css" type="text/css" rel="stylesheet">

<link href="Styles/Flamenco1/Menu.css" type="text/css" rel="stylesheet">

<script language="JavaScript" type="text/javascript">

//End Include User Scripts
 

//Date Picker Object Definitions @1-179FCDD0
 

var Grid2_DatePicker_s_Start_Start1 = new Object(); 

Grid2_DatePicker_s_Start_Start1.format           = "yyyy/mm/dd hh:nn:ss";

Grid2_DatePicker_s_Start_Start1.style            = "Styles/Flamenco1/Style.css";

Grid2_DatePicker_s_Start_Start1.relativePathPart = "";

Grid2_DatePicker_s_Start_Start1.themeVersion = "3.0";
 

var Grid2_DatePicker_s_Start_Stop1 = new Object(); 

Grid2_DatePicker_s_Start_Stop1.format           = "yyyy/mm/dd hh:nn:ss";

Grid2_DatePicker_s_Start_Stop1.style            = "Styles/Flamenco1/Style.css";

Grid2_DatePicker_s_Start_Stop1.relativePathPart = "";

Grid2_DatePicker_s_Start_Stop1.themeVersion = "3.0";
 

//End Date Picker Object Definitions
 

//_OnLoad @1-2F43613D
 

function _OnLoad()

{

    var result;

//End _OnLoad
 

//Close _OnLoad @1-BC33A33A

    return result;

}

//End Close _OnLoad
 

//bind_events @1-C6C5CA6C

function bind_events() {

    addEventHandler("Menu1Container", "load", load_ADxMenu);

    addEventHandler("", "load", _OnLoad);

}

//End bind_events
 

window.onload = bind_events; //Assign bind_events @1-19F7B649
 

//End CCS script

</script>

<!--[if IE 6]><link rel="stylesheet" type="text/css" href="Styles/{CCS_Style}/Style_ie6.css"><![endif]-->

<!--[if IE 6]><link rel="stylesheet" type="text/css" href="Styles/{CCS_Style}/Style_Components_ie6.css"><![endif]-->

<link media="screen, tv, projection" href="Styles/adx.css" type="text/css" rel="stylesheet">

<script src="js/menu/ADxMenu.js" type="text/javascript"></script>

<link media="screen, tv, projection" href="Styles/Flamenco1/Menu.css" type="text/css" rel="stylesheet">

<link href="Styles/Flamenco1/Style_doctype.css" type="text/css" rel="stylesheet">

</head>

<body>

&nbsp;&nbsp;&nbsp; 

<div id="DivId">

  <script>

function ajaxRequest(url,DivId)

{

var AJAX;

try

{

AJAX = new XMLHttpRequest();

}

catch(e)

{

try

{

AJAX = new ActiveXObject("Msxml2.XMLHTTP");

}

catch(e)

{

try

{

AJAX = new ActiveXObject("Microsoft.XMLHTTP");

}

catch(e)

{

alert("Your browser does not support AJAX.");

return false;

}

}

}

AJAX.onreadystatechange = function()

{

if(AJAX.readyState == 4)

{

if(AJAX.status == 200)

{

document.getElementById("DivId").style.display="none";

}

else

{

alert("Error: "+ AJAX.statusText +" "+ AJAX.status);

}

//hideLoadingPanel()

displayLoadingPanel();

}

else

{

//hideLoadingPanel();

displayLoadingPanel();

}

}

AJAX.open("get", "http://localhost/GF_Data_Reporting/Sub_Report_Packing_Lines.asp", true);

AJAX.send(null);

}

</script>

</div>

<table align="left" border="0">

  <tr>

    <td>

      <!-- BEGIN Menu Menu1 -->

      <div class="MenuStyle" id="Menu1Container">

        <ul class="adxm {Menu1:MenuType} level1">

          <!-- BEGIN Item -->

          <!-- BEGIN OpenLevel -->

          <ul class="level{Menu1:Item_Level}">

            <!-- END OpenLevel -->

            <li {Menu1:DefaultItem}><a href="{ItemLink_Src}" class="{Menu1:Submenu}" target="{Menu1:Target}" title="{Menu1:Title}">{ItemLink}</a> 

            <!-- BEGIN CloseItem --></li>

 <!-- END CloseItem -->

            <!-- BEGIN CloseLevel -->

          </ul>

 </li>

 <!-- END CloseLevel --><!-- END Item -->

        </ul>

 

      </div>

      <!-- END Menu Menu1 --></td>

  </tr>

</table>

<p>&nbsp;</p>

<p>

<hr style="COLOR: #ff6600" size="2">

<p></p>

<table align="center" border="0">

  <tr>

    <td>&nbsp;</td> 

    <td>

      <!-- BEGIN Record Grid2 -->

      <form name="{HTMLFormName}" action="{Action}" method="post">

        <h2>Generate Report&nbsp;All Lines</h2>

 

        <table>

          <!-- BEGIN Error -->

          <tr>

            <td colspan="2">{Error}</td>

          </tr>

          <!-- END Error -->

          <tr>

            <td><label for="Grid2s_Start_Start">StartDate:</label></td> 

            <td><input id="Grid2s_Start_Start" style="WIDTH: 168px; HEIGHT: 22px" maxlength="100" size="18" value="{s_Start_Start}" name="{s_Start_Start_Name}">

              <!-- BEGIN DatePicker DatePicker_s_Start_Start1 --><a href="javascript:showDatePicker('{Name}','{FormName}','{DateControl}');" id="Grid2DatePicker_s_Start_Start1"><img id="Grid2DatePicker_s_Start_Start1_Image" alt="Show Date Picker" src="Styles/Flamenco1/Images/DatePicker.gif" border="0"></a>&nbsp;&nbsp;<!-- END DatePicker DatePicker_s_Start_Start1 --></td>

          </tr>

 

          <tr>

            <td>Stop Date:</td> 

            <td><input id="Grid2s_Start_Stop" style="WIDTH: 168px; HEIGHT: 22px" size="22" value="{s_Start_Stop}" name="{s_Start_Stop_Name}">

              <!-- BEGIN DatePicker DatePicker_s_Start_Stop1 --><a href="javascript:showDatePicker('{Name}','{FormName}','{DateControl}');" id="Grid2DatePicker_s_Start_Stop1"><img id="Grid2DatePicker_s_Start_Stop1_Image" alt="Show Date Picker" src="Styles/Flamenco1/Images/DatePicker.gif" border="0"></a>&nbsp;&nbsp;<!-- END DatePicker DatePicker_s_Start_Stop1 --></td>

          </tr>

 

          <tr>

            <td><label for="Grid2Grid2Order">Sort by</label></td> 

            <td>

              <select id="Grid2Grid2Order" name="Grid2Order">

                {Grid2Order_Options}

              </select>

 <label for="Grid2Grid2Dir" style="display: none;">{res:CCS_SortDir}</label> 

              <select id="Grid2Grid2Dir" name="Grid2Dir">

                {Grid2Dir_Options}

              </select>

 </td>

          </tr>

 

          <tr>

            <td><label for="Grid2Grid2PageSize">Records per page</label></td> 

            <td>

              <select id="Grid2Grid2PageSize" name="{Grid2PageSize_Name}">

                {Grid2PageSize_Options}

              </select>

 </td>

          </tr>

 

          <tr>

            <td align="right" colspan="2">

              <!-- BEGIN Button Button_DoSearch --><input id="Grid2Button_DoSearch" onclick="ajaxRequest()" type="submit" alt="Search" value="Search" name="{Button_Name}"><!-- END Button Button_DoSearch --></td>

          </tr>

        </table>

      </form>

      &nbsp;&nbsp;<!-- END Record Grid2 -->&nbsp;&nbsp;</td>

  </tr>

</table>

<br>

<hr style="COLOR: #ff6600" size="2">

</body>

</html>

Open in new window

0
 

Author Comment

by:Latzi_Marian
ID: 24406025
I meant to say "I've got the code working by making line 117 from my code the same with line 122. on the above posted code.
0
 

Author Closing Comment

by:Latzi_Marian
ID: 31582139
Helped me to sort out the problem.Thank you.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now