By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,741 Members | 2,004 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,741 IT Pros & Developers. It's quick & easy.

Runtime-fout Microsoft JScript: 'document.OverurenDecl.txtMedewerker' is empty or not

P: 72
Hey Guys,

i have a question about that error is there a specfick thing were the error on focus becase i have a DOTNET project and it shows on almost evry page that error if i whanne add something only the name of the document and txtbox is diferent on the other pages

Pleas help me

this is the compleet error Runtime-fout Microsoft JScript: 'document.OverurenDecl.txtMedewerker' is empty or not an object
Oct 14 '08 #1
Share this Question
Share on Google+
26 Replies


acoder
Expert Mod 15k+
P: 16,027
It's difficult to say without seeing some code. Post your code.
Oct 14 '08 #2

P: 72
okey i have 2 pages were i am working from both aspx and he problery whants to take a value from a javascript

well okey here is some of the code were i think the error is being caused

OverurenDecl.aspx this is the page were i whanne go to by the press of a button

Expand|Select|Wrap|Line Numbers
  1. <%@ Page language="c#" Inherits="DotNet.OverurenDecl" CodeFile="OverurenDecl.aspx.cs" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  3. <HTML>
  4.     <HEAD>
  5.         <title>OverurenDecl</title>
  6.         <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
  7.         <meta content="C#" name="CODE_LANGUAGE">
  8.         <meta content="JavaScript" name="vs_defaultClientScript">
  9.         <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  10.         <script language="javascript" src="AlgemeneFuncties.js"></script>
  11.         <script language="javascript">
  12.         function UpdateTotal()
  13.         {
  14.             var Total = 0;
  15.             var i;
  16.             for(i=0; document.getElementById('UpdateTijd' + i); i++)
  17.             {
  18.                 Total = Total + document.getElementById('UpdateTijd' + i).value.replace(",",".") * 1;
  19.             }
  20.             Total = Total + document.OverurenDecl.NewTijd0.value.replace(",",".") * 1;
  21.             Total = Total + document.OverurenDecl.NewTijd1.value.replace(",",".") * 1;
  22.             Total = Total + document.OverurenDecl.NewTijd2.value.replace(",",".") * 1;
  23.             Total = Total + document.OverurenDecl.NewTijd3.value.replace(",",".") * 1;
  24.             Total = Total + document.OverurenDecl.NewTijd4.value.replace(",",".") * 1;
  25.  
  26.             document.OverurenDecl.txtTotaalTijd.value = Total;
  27.         }
  28.  
  29.         function CalcUren(TijdVan, TijdTot, Pauze, Tijd)
  30.         {
  31.             Tijd.readOnly = !Pauze;
  32.             if (Pauze)
  33.                 return;
  34.             var Tijd1 = GetMin(TijdVan.value) * 1;
  35.             Tijd1 += GetUur(TijdVan.value) * 60;
  36.             var Tijd2 = GetMin(TijdTot.value) * 1;
  37.             Tijd2 += GetUur(TijdTot.value) * 60;
  38.             if (Tijd1 < 0 || Tijd2 < 0)
  39.                 return;
  40.             Tijd.value = (Tijd2 - Tijd1) / 60;
  41.             TijdVan.value = Math.floor(Tijd1 / 60) + ":" + FixZero(Tijd1 % 60);
  42.             TijdTot.value = Math.floor(Tijd2 / 60) + ":" + FixZero(Tijd2 % 60);
  43.             UpdateTotal();
  44.         }
  45.         </script>
  46.         <LINK href="style.css" type="text/css" rel="stylesheet">
  47.     </HEAD>
  48.     <body onload="InitCombobox(document.OverurenDecl.txtMedewerker, document.OverurenDecl.ddlMedewerker);UpdateTotal();">
  49.         <form method="post" runat="server">
  50.             <h1>Overuren Declaratie</h1>
  51.             <asp:dropdownlist id="ddlMedewerker" style="Z-INDEX: 101; LEFT: 177px; POSITION: absolute; TOP: 86px" runat="server" AutoPostBack="True" Width="300px" onselectedindexchanged="ddlMedewerker_SelectedIndexChanged"></asp:dropdownlist>
  52.             <table width="728">
  53.                 <tr>
  54.                     <td style="WIDTH: 334px" align="right"><asp:imagebutton id="imgVerwijder" onfocus="this.blur()" tabIndex="23" runat="server" Visible="False" ImageUrl="images\verwijderen.gif"></asp:imagebutton></td>
  55.                     <td style="WIDTH: 196px" align="right" width="196"><asp:imagebutton id="imgBtnEdit" tabIndex="24" runat="server" ImageUrl="images\opslaan.gif"></asp:imagebutton></td>
  56.                     <td align="right" width="200"><asp:imagebutton id="imgAfdruk" tabIndex="25" runat="server" ImageUrl="images\VZprintenopslaan.gif"></asp:imagebutton></td>
  57.                 </tr>
  58.             </table>
  59.             <br>
  60.             <table width="100%">
  61.                 <tr>
  62.                     <td>Medewerker</td>
  63.                     <td colSpan="3"><asp:textbox id="txtMedewerker" onkeyup="javascript:KlantlijstChange(document.OverurenDecl.txtMedewerker, document.OverurenDecl.ddlMedewerker);" runat="server" Width="300px"></asp:textbox></td>
  64.                 </tr>
  65.                 <tr>
  66.                     <td>Woonplaats</td>
  67.                     <td colSpan="3"><asp:textbox id="txtWoonplaats" runat="server" Width="300px"></asp:textbox></td>
  68.                 </tr>
  69.                 <tr>
  70.                     <td>BankNR</td>
  71.                     <td><asp:textbox id="txtBankNR" runat="server"></asp:textbox></td>
  72.                     <td align="right" rowSpan="2">Verrekenen:</td>
  73.                     <td rowSpan="2"><asp:radiobuttonlist id="optVerreken" runat="server">
  74.                             <asp:ListItem Value="0" Selected="True">Uitbetalen</asp:ListItem>
  75.                             <asp:ListItem Value="1">Compenseren</asp:ListItem>
  76.                         </asp:radiobuttonlist></td>
  77.                 </tr>
  78.                 <tr>
  79.                     <td>GiroNR</td>
  80.                     <td><asp:textbox id="txtGiroNR" runat="server"></asp:textbox></td>
  81.                 </tr>
  82.                 <tr>
  83.                     <td>Datum Ingeleverd</td>
  84.                     <td><asp:textbox id="txtDatum" runat="server"></asp:textbox></td>
  85.                     <td align="right">Verwerkt:</td>
  86.                     <td><asp:checkbox id="chkVerwerkt" runat="server"></asp:checkbox></td>
  87.                 </tr>
  88.             </table>
  89.             <br>
  90.             <table cellSpacing="0" cellPadding="0">
  91.                 <tr>
  92.                     <th>
  93.                         Datum</th>
  94.                     <th>
  95.                         Van</th>
  96.                     <th>
  97.                         Tot</th>
  98.                     <th>
  99.                         Relatie</th>
  100.                     <th>
  101.                         Pauze</th>
  102.                     <th>
  103.                         Tijd Totaal</th></tr>
  104.                 <span id="TableSpan" runat="server"></span>
  105.                 <tr>
  106.                     <td><input type="text" size="10" name="NewDatum0"></td>
  107.                     <td><input onblur="CalcUren(NewTijdVan0, NewTijdTot0, NewPauze0.checked, NewTijd0)" type="text" size="5" name="NewTijdVan0"></td>
  108.                     <td><input onblur="CalcUren(NewTijdVan0, NewTijdTot0, NewPauze0.checked, NewTijd0)" type="text" size="5" name="NewTijdTot0"></td>
  109.                     <td><input type="text" size="30" name="NewRelatie0"></td>
  110.                     <td align="middle"><input onclick="CalcUren(NewTijdVan0, NewTijdTot0, NewPauze0.checked, NewTijd0)" type="checkbox" name="NewPauze0"></td>
  111.                     <td><input onblur="UpdateTotal();" readOnly type="text" size="10" name="NewTijd0"></td>
  112.                 </tr>
  113.                 <tr>
  114.                     <td><input type="text" size="10" name="NewDatum1"></td>
  115.                     <td><input onblur="CalcUren(NewTijdVan1, NewTijdTot1, NewPauze1.checked, NewTijd1)" type="text" size="5" name="NewTijdVan1"></td>
  116.                     <td><input onblur="CalcUren(NewTijdVan1, NewTijdTot1, NewPauze1.checked, NewTijd1)" type="text" size="5" name="NewTijdTot1"></td>
  117.                     <td><input type="text" size="30" name="NewRelatie1"></td>
  118.                     <td align="middle"><input onclick="CalcUren(NewTijdVan1, NewTijdTot1, NewPauze1.checked, NewTijd1)" type="checkbox" name="NewPauze1"></td>
  119.                     <td><input onblur="UpdateTotal();" readOnly type="text" size="10" name="NewTijd1"></td>
  120.                 </tr>
  121.                 <tr>
  122.                     <td><input type="text" size="10" name="NewDatum2"></td>
  123.                     <td><input onblur="CalcUren(NewTijdVan2, NewTijdTot2, NewPauze2.checked, NewTijd2)" type="text" size="5" name="NewTijdVan2"></td>
  124.                     <td><input onblur="CalcUren(NewTijdVan2, NewTijdTot2, NewPauze2.checked, NewTijd2)" type="text" size="5" name="NewTijdTot2"></td>
  125.                     <td><input type="text" size="30" name="NewRelatie2"></td>
  126.                     <td align="middle"><input onclick="CalcUren(NewTijdVan2, NewTijdTot2, NewPauze2.checked, NewTijd2)" type="checkbox" name="NewPauze2"></td>
  127.                     <td><input onblur="UpdateTotal();" readOnly type="text" size="10" name="NewTijd2"></td>
  128.                 </tr>
  129.                 <tr>
  130.                     <td><input type="text" size="10" name="NewDatum3"></td>
  131.                     <td><input onblur="CalcUren(NewTijdVan3, NewTijdTot3, NewPauze3.checked, NewTijd3)" type="text" size="5" name="NewTijdVan3"></td>
  132.                     <td><input onblur="CalcUren(NewTijdVan3, NewTijdTot3, NewPauze3.checked, NewTijd3)" type="text" size="5" name="NewTijdTot3"></td>
  133.                     <td><input type="text" size="30" name="NewRelatie3"></td>
  134.                     <td align="middle"><input onclick="CalcUren(NewTijdVan3, NewTijdTot3, NewPauze3.checked, NewTijd3)" type="checkbox" name="NewPauze3"></td>
  135.                     <td><input onblur="UpdateTotal();" readOnly type="text" size="10" name="NewTijd3"></td>
  136.                 </tr>
  137.                 <tr>
  138.                     <td><input type="text" size="10" name="NewDatum4"></td>
  139.                     <td><input onblur="CalcUren(NewTijdVan4, NewTijdTot4, NewPauze4.checked, NewTijd4)" type="text" size="5" name="NewTijdVan4"></td>
  140.                     <td><input onblur="CalcUren(NewTijdVan4, NewTijdTot4, NewPauze4.checked, NewTijd4)" type="text" size="5" name="NewTijdTot4"></td>
  141.                     <td><input type="text" size="30" name="NewRelatie4"></td>
  142.                     <td align="middle"><input onclick="CalcUren(NewTijdVan4, NewTijdTot4, NewPauze4.checked, NewTijd4)" type="checkbox" name="NewPauze4"></td>
  143.                     <td><input onblur="UpdateTotal();" readOnly type="text" size="10" name="NewTijd4"></td>
  144.                 </tr>
  145.                 <tr>
  146.                     <td align="right" colSpan="5">Totaal Tijd:
  147.                     </td>
  148.                     <td><asp:textbox id="txtTotaalTijd" runat="server" size="10" ReadOnly="True">0</asp:textbox></td>
  149.                 </tr>
  150.             </table>
  151.             <br>
  152.             <table width="728">
  153.                 <tr>
  154.                     <td style="WIDTH: 334px" align="right"><asp:imagebutton id="imgDelete" onfocus="this.blur()" tabIndex="23" runat="server" Visible="False" ImageUrl="images\verwijderen.gif"></asp:imagebutton></td>
  155.                     <td align="right"><asp:imagebutton id="btnSave" tabIndex="24" runat="server" ImageUrl="images\opslaan.gif"></asp:imagebutton></td>
  156.                     <td align="right"><asp:imagebutton id="btnSavePrint" tabIndex="25" runat="server" ImageUrl="images\VZprintenopslaan.gif"></asp:imagebutton></td>
  157.                 </tr>
  158.             </table>
  159.         </form>
  160.     </body>
  161. </HTML>
  162.  
this is the page were the button is to get 2 the page abbouve
OverurenDecl_Overzicht.aspx

Expand|Select|Wrap|Line Numbers
  1. <%@ Reference Page="~/OverurenDecl.aspx" %>
  2. <%@ Page language="c#" Inherits="DotNet.OverurenDecl_Overzicht" CodeFile="OverurenDecl_Overzicht.aspx.cs" %>
  3. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  4. <HTML>
  5.     <HEAD>
  6.         <title>OverurenDecl_Overzicht</title>
  7.         <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
  8.         <meta name="CODE_LANGUAGE" Content="C#">
  9.         <meta name="vs_defaultClientScript" content="JavaScript">
  10.         <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
  11.         <script language="javascript" src="AlgemeneFuncties.js"></script>
  12.         <LINK href="style.css" type="text/css" rel="stylesheet">
  13.     </HEAD>
  14.     <body>
  15.         <form method="post" runat="server">
  16.             <h1>Overuren Declaratie</h1>
  17.             <table width="80%">
  18.                 <tr>
  19.                     <td><asp:ImageButton id="imgbtnToevoegen" onfocus="this.blur()" runat="server" ImageUrl="images\toevoegen.gif"></asp:ImageButton>
  20.                     </td>
  21.                     <td align="right">Jaar:<asp:DropDownList id="DDLJaar" runat="server" AutoPostBack="True"></asp:DropDownList></td>
  22.                 </tr>
  23.             </table>
  24.             <span id="TableSpan" runat="server"></span>
  25.         </form>
  26.     </body>
  27. </HTML>
  28.  

i dont now if you need more code like the javascript but i whont post i yet becase otherwise there will be a hole lot af code if you need more code from a other document just let me know
Oct 14 '08 #3

P: 72
maybe you whanne look true this code to the javascript it contains the function InitCombobox

algemenefuncties.js

Expand|Select|Wrap|Line Numbers
  1. //the text in textbox search in dropdownlist and adding the name if you whant from dropdownlist
  2. function KlantlijstChange(TextBox, DropDownBox)
  3. {
  4.     if (!TextBox || !DropDownBox)
  5.         return;
  6.  
  7.     if (( event.keyCode < 48  ||  event.keyCode > 57 ) && ( event.keyCode < 65 || event.keyCode > 90 ))
  8.         return;
  9.  
  10.     var Text = TextBox.value.toUpperCase();
  11.     var iLen = DropDownBox.options.length;
  12.     var iIndex;
  13.     var sCurrentText;
  14.     var bFound;
  15.  
  16.     for (iIndex=0; iIndex<iLen; iIndex++)
  17.     {
  18.         sCurrentText = DropDownBox.options[ iIndex ].text;
  19.         sCurrentText = sCurrentText.toUpperCase();
  20.  
  21.         bFound = (sCurrentText.indexOf(Text) == 0);
  22.  
  23.         if ( bFound )
  24.         {
  25.             TextBox.value = DropDownBox.options[ iIndex ].text;
  26.  
  27.             TextBox.focus();
  28.             TextBox.select();
  29.  
  30.             var oTextRange = TextBox.createTextRange();
  31.             oTextRange.moveStart("character", Text.length);
  32.             oTextRange.select();
  33.  
  34.             DropDownBox.selectedIndex = iIndex;
  35.             return;
  36.         }
  37.     }
  38.  
  39. }
  40.  
  41. //making sure the dropdownlist fals over the textbox
  42. //wich will make some kind of combobox
  43. function InitCombobox(Textbox, Dropdownlist)
  44. {
  45.     if (!Textbox || !Dropdownlist)
  46.         return;
  47.     Dropdownlist.style.position    = "absolute";
  48.     Dropdownlist.style.setExpression("pixelLeft", "absolute_X(" + Textbox.id + ")");
  49.     Dropdownlist.style.setExpression("pixelTop", "absolute_Y(" + Textbox.id + ")");
  50.     Dropdownlist.style.setExpression("clip","'rect(auto auto auto ' + (offsetWidth - 18) + ')'");
  51. }
  52.  
  53. function absolute_X( theElement )
  54. {
  55.     var xPosition = 0;
  56.  
  57.     while ( ( theElement != null ))// && (theElement.tagName != "TABLE"))
  58.     {
  59.         xPosition += theElement.offsetLeft;
  60.         theElement = theElement.offsetParent;
  61.     }
  62.  
  63.     return xPosition;
  64. }
  65.  
  66. function absolute_Y( theElement )
  67. {
  68.     var yPosition = 0;
  69.  
  70.     while ( ( theElement != null ))// && (theElement.tagName != "TABLE"))
  71.     {
  72.         yPosition += theElement.offsetTop;
  73.         theElement = theElement.offsetParent;
  74.     }
  75.  
  76.     return yPosition;
  77. }
Oct 14 '08 #4

acoder
Expert Mod 15k+
P: 16,027
Post the client-side version of your ASP.NET code. Is your form named "OverurenDecl"?
Oct 14 '08 #5

P: 72
uhm i know that the forms name is ctl00 but if i use that i still get the error dont realy know what you mean with client side but here is the aspx code from my OverurenDecl.aspx how you look at the code in IE

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  2. <HTML>
  3.     <HEAD>
  4.         <title>OverurenDecl_Overzicht</title>
  5.         <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
  6.         <meta name="CODE_LANGUAGE" Content="C#">
  7.         <meta name="vs_defaultClientScript" content="JavaScript">
  8.         <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
  9.         <script language="javascript" src="AlgemeneFuncties.js"></script>
  10.         <LINK href="style.css" type="text/css" rel="stylesheet">
  11.     </HEAD>
  12.     <body>
  13.         <form name="ctl00" method="post" action="OverurenDecl_Overzicht.aspx" id="ctl00">
  14. <div>
  15. <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
  16. <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
  17. <input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="" />
  18. <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNDQzODY0MjQwD2QWAgIBD2QWBAIDDxBkEBUHBDIwMDgEMjAwNwQyMDA2BDIwMDUEMjAwNAQyMDAzBEFsbGUVBwQyMDA4BDIwMDcEMjAwNgQyMDA1BDIwMDQEMjAwMwRBbGxlFCsDB2dnZ2dnZ2dkZAIFDxYCHglpbm5lcmh0bWwFpAI8dHI+PHRkIHZhbGlnbj10b3A+PGEgaHJlZj0iT3ZlcnVyZW5EZWNsLmFzcHg/SUQ9MTIiPjEyPC9hPjwvdGQ+PHRkIHZhbGlnbj10b3A+Jm5ic3A7PC90ZD48dGQgdmFsaWduPXRvcD4mbmJzcDs8L3RkPjx0ZCB2YWxpZ249dG9wPk5lZTwvdGQ+PC90cj48dHI+PHRoIGNsYXNzPSJCb3R0b20iPiZuYnNwOzwvdGg+PHRoIGFsaWduPSJyaWdodCIgY2xhc3M9IkJvdHRvbSI+VG90YWFsOiZuYnNwOzwvdGg+PHRoIGNvbHNwYW49IjIiIGFsaWduPSJsZWZ0IiBjbGFzcz0iQm90dG9tIj4wPC90aD48L3RyPjwvdGFibGU+ZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUPaW1nYnRuVG9ldm9lZ2Vuo+LLEindwkPB5ULdV4e73jpK3ls=" />
  19. </div>
  20.  
  21. <script type="text/javascript">
  22. //<![CDATA[
  23. var theForm = document.forms['ctl00'];
  24. if (!theForm) {
  25.     theForm = document.ctl00;
  26. }
  27. function __doPostBack(eventTarget, eventArgument) {
  28.     if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
  29.         theForm.__EVENTTARGET.value = eventTarget;
  30.         theForm.__EVENTARGUMENT.value = eventArgument;
  31.         theForm.submit();
  32.     }
  33. }
  34. //]]>
  35. </script>
  36.  
  37.  
  38. <div>
  39.  
  40.     <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWCgKDsdTtDAKMxcehAQL3rMbpBwLfgquJAgLfgofgBALfgpONDALfgq/WAwLfgrvzCgLfgtefAgKK46zhAQ/BbCqSPUSuSJ49qC+NCmxmOC40" />
  41. </div>
  42.             <h1>Overuren Declaratie</h1>
  43.             <table width="80%">
  44.                 <tr>
  45.                     <td><input type="image" name="imgbtnToevoegen" id="imgbtnToevoegen" onfocus="this.blur()" src="images\toevoegen.gif" style="border-width:0px;" />
  46.                     </td>
  47.                     <td align="right">Jaar:<select name="DDLJaar" onchange="javascript:setTimeout('__doPostBack(\'DDLJaar\',\'\')', 0)" id="DDLJaar">
  48.     <option selected="selected" value="2008">2008</option>
  49.     <option value="2007">2007</option>
  50.     <option value="2006">2006</option>
  51.     <option value="2005">2005</option>
  52.     <option value="2004">2004</option>
  53.     <option value="2003">2003</option>
  54.     <option value="Alle">Alle</option>
  55.  
  56. </select></td>
  57.                 </tr>
  58.             </table>
  59.             <span id="TableSpan"><tr><td valign=top><a href="OverurenDecl.aspx?ID=12">12</a></td><td valign=top>&nbsp;</td><td valign=top>&nbsp;</td><td valign=top>Nee</td></tr><tr><th class="Bottom">&nbsp;</th><th align="right" class="Bottom">Totaal:&nbsp;</th><th colspan="2" align="left" class="Bottom">0</th></tr></table></span>
  60.         </form>
  61.     </body>
  62. </HTML>
  63.  
Oct 14 '08 #6

acoder
Expert Mod 15k+
P: 16,027
If that's the case, then wherever you have document.OverurenDecl replace with document.ct100 or document.forms['ct100']
Oct 14 '08 #7

P: 72
Nop srry dident work i still get the same error and the weird thing is that it looks like the error is show after </HTML>OverurenDecl_Overzicht have any other idee's i can try
Oct 15 '08 #8

acoder
Expert Mod 15k+
P: 16,027
I think you've showed the client-side code for OverurenDecl_Overzicht.aspx. Show me the code for OverurenDecl.aspx (what you posted in post #3, but the client-side version).
Oct 15 '08 #9

P: 72
okey your right is see but the problem is that i cant look the code from my dotnet application thats offline there also is a online version of it that is working so i will post that code now but then there can be minor differences becase that is the code that is made in Visual Studio 7 and now i am changing it in 2005 hope you can use it

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  2. <HTML>
  3.     <HEAD>
  4.         <title>OverurenDecl</title>
  5.         <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
  6.         <meta content="C#" name="CODE_LANGUAGE">
  7.         <meta content="JavaScript" name="vs_defaultClientScript">
  8.         <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  9.         <script language="javascript" src="AlgemeneFuncties.js"></script>
  10.         <script language="javascript">
  11.         function UpdateTotal()
  12.         {
  13.             var Total = 0;
  14.             var i;
  15.             for(i=0; document.getElementById('UpdateTijd' + i); i++)
  16.             {
  17.                 Total = Total + document.getElementById('UpdateTijd' + i).value.replace(",",".") * 1;
  18.             }
  19.             Total = Total + document.OverurenDecl.NewTijd0.value.replace(",",".") * 1;
  20.             Total = Total + document.OverurenDecl.NewTijd1.value.replace(",",".") * 1;
  21.             Total = Total + document.OverurenDecl.NewTijd2.value.replace(",",".") * 1;
  22.             Total = Total + document.OverurenDecl.NewTijd3.value.replace(",",".") * 1;
  23.             Total = Total + document.OverurenDecl.NewTijd4.value.replace(",",".") * 1;
  24.  
  25.             document.OverurenDecl.txtTotaalTijd.value = Total;
  26.         }
  27.  
  28.         function CalcUren(TijdVan, TijdTot, Pauze, Tijd)
  29.         {
  30.             Tijd.readOnly = !Pauze;
  31.             if (Pauze)
  32.                 return;
  33.             var Tijd1 = GetMin(TijdVan.value) * 1;
  34.             Tijd1 += GetUur(TijdVan.value) * 60;
  35.             var Tijd2 = GetMin(TijdTot.value) * 1;
  36.             Tijd2 += GetUur(TijdTot.value) * 60;
  37.             if (Tijd1 < 0 || Tijd2 < 0)
  38.                 return;
  39.             Tijd.value = (Tijd2 - Tijd1) / 60;
  40.             TijdVan.value = Math.floor(Tijd1 / 60) + ":" + FixZero(Tijd1 % 60);
  41.             TijdTot.value = Math.floor(Tijd2 / 60) + ":" + FixZero(Tijd2 % 60);
  42.             UpdateTotal();
  43.         }
  44.         </script>
  45.         <LINK href="style.css" type="text/css" rel="stylesheet">
  46.     </HEAD>
  47.     <body onload="InitCombobox(document.OverurenDecl.txtMedewerker, document.OverurenDecl.ddlMedewerker);UpdateTotal();" MS_POSITIONING="GridLayout">
  48.         <form name="OverurenDecl" method="post" action="OverurenDecl.aspx" id="OverurenDecl">
  49. <input type="hidden" name="__EVENTTARGET" value="" />
  50. <input type="hidden" name="__EVENTARGUMENT" value="" />
  51. <input type="hidden" name="__VIEWSTATE" value="dDw1NzQ0ODkzMjI7dDw7bDxpPDE+Oz47bDx0PDtsPGk8MT47PjtsPHQ8dDw7dDxpPDExPjtAPEFsbGVydCBWaXNzZXI7QW5nZWxhIFBvbDtBbml0YSBkZSBCb295O0VkaXRoIFZpc3NlcjtFcmljIHZhbiBIZWlqbnNiZXJnZW47RnJhbmsgdmFuIGRlbiBCZXJnO0hhbiBCcmVucztIZW5yeSBDaGFybGVzO0xvdWsgTGFhZ2xhbmQ7TWljaGllbCBXb3J0bWFuO3N1cHBvcnQ7PjtAPEFsbGVydCBWaXNzZXI7QW5nZWxhIFBvbDtBbml0YSBkZSBCb295O0VkaXRoIFZpc3NlcjtFcmljIHZhbiBIZWlqbnNiZXJnZW47RnJhbmsgdmFuIGRlbiBCZXJnO0hhbiBCcmVucztIZW5yeSBDaGFybGVzO0xvdWsgTGFhZ2xhbmQ7TWljaGllbCBXb3J0bWFuO3N1cHBvcnQ7Pj47Pjs7Pjs+Pjs+PjtsPGltZ0J0bkVkaXQ7aW1nQWZkcnVrO2Noa1Zlcndlcmt0O2J0blNhdmU7YnRuU2F2ZVByaW50Oz4+3/RzWmltkeq6bg3xRMmW61haTKw=" />
  52.  
  53. <script language="javascript" type="text/javascript">
  54. <!--
  55.     function __doPostBack(eventTarget, eventArgument) {
  56.         var theform;
  57.         if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
  58.             theform = document.OverurenDecl;
  59.         }
  60.         else {
  61.             theform = document.forms["OverurenDecl"];
  62.         }
  63.         theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
  64.         theform.__EVENTARGUMENT.value = eventArgument;
  65.         theform.submit();
  66.     }
  67. // -->
  68. </script>
  69.  
  70.             <h1>Overuren Declaratie</h1>
  71.             <select name="ddlMedewerker" onchange="__doPostBack('ddlMedewerker','')" language="javascript" id="ddlMedewerker" style="width:300px;Z-INDEX: 101; LEFT: 177px; POSITION: absolute; TOP: 86px">
  72.     <option value="***">***</option>
  73.     <option value="***">***</option>
  74.     <option value="***">***</option>
  75.     <option value="***">***</option>
  76.     <option value="***">****</option>
  77.     <option value="****">****</option>
  78.     <option value="***">***</option>
  79.     <option value="***">***</option>
  80.     <option value="****">****</option>
  81.     <option value="***">****</option>
  82.     <option value="support">support</option>
  83.  
  84. </select>
  85.             <table width="728">
  86.                 <tr>
  87.                     <td style="WIDTH: 334px" align="right"></td>
  88.                     <td style="WIDTH: 196px" align="right" width="196"><input type="image" name="imgBtnEdit" id="imgBtnEdit" tabindex="24" src="images\opslaan.gif" alt="" border="0" /></td>
  89.                     <td align="right" width="200"><input type="image" name="imgAfdruk" id="imgAfdruk" tabindex="25" src="images\VZprintenopslaan.gif" alt="" border="0" /></td>
  90.                 </tr>
  91.             </table>
  92.             <br>
  93.             <table width="100%">
  94.                 <tr>
  95.                     <td>Medewerker</td>
  96.                     <td colSpan="3"><input name="txtMedewerker" type="text" id="txtMedewerker" onkeyup="javascript:KlantlijstChange(document.OverurenDecl.txtMedewerker, document.OverurenDecl.ddlMedewerker);" style="width:300px;" /></td>
  97.                 </tr>
  98.                 <tr>
  99.                     <td>Woonplaats</td>
  100.                     <td colSpan="3"><input name="txtWoonplaats" type="text" id="txtWoonplaats" style="width:300px;" /></td>
  101.                 </tr>
  102.                 <tr>
  103.                     <td>BankNR</td>
  104.                     <td><input name="txtBankNR" type="text" id="txtBankNR" /></td>
  105.                     <td align="right" rowSpan="2">Verrekenen:</td>
  106.                     <td rowSpan="2"><table id="optVerreken" border="0">
  107.     <tr>
  108.         <td><input id="optVerreken_0" type="radio" name="optVerreken" value="0" checked="checked" /><label for="optVerreken_0">Uitbetalen</label></td>
  109.     </tr><tr>
  110.         <td><input id="optVerreken_1" type="radio" name="optVerreken" value="1" /><label for="optVerreken_1">Compenseren</label></td>
  111.     </tr>
  112. </table></td>
  113.                 </tr>
  114.                 <tr>
  115.                     <td>GiroNR</td>
  116.                     <td><input name="txtGiroNR" type="text" id="txtGiroNR" /></td>
  117.                 </tr>
  118.                 <tr>
  119.                     <td>Datum Ingeleverd</td>
  120.                     <td><input name="txtDatum" type="text" id="txtDatum" /></td>
  121.                     <td align="right">Verwerkt:</td>
  122.                     <td><input id="chkVerwerkt" type="checkbox" name="chkVerwerkt" /></td>
  123.                 </tr>
  124.             </table>
  125.             <br>
  126.             <table cellSpacing="0" cellPadding="0">
  127.                 <tr>
  128.                     <th>
  129.                         Datum</th>
  130.                     <th>
  131.                         Van</th>
  132.                     <th>
  133.                         Tot</th>
  134.                     <th>
  135.                         Relatie</th>
  136.                     <th>
  137.                         Pauze</th>
  138.                     <th>
  139.                         Tijd Totaal</th></tr>
  140.                 <span id="TableSpan"></span>
  141.                 <tr>
  142.                     <td><input type="text" size="10" name="NewDatum0"></td>
  143.                     <td><input onblur="CalcUren(NewTijdVan0, NewTijdTot0, NewPauze0.checked, NewTijd0)" type="text" size="5" name="NewTijdVan0"></td>
  144.                     <td><input onblur="CalcUren(NewTijdVan0, NewTijdTot0, NewPauze0.checked, NewTijd0)" type="text" size="5" name="NewTijdTot0"></td>
  145.                     <td><input type="text" size="30" name="NewRelatie0"></td>
  146.                     <td align="middle"><input onclick="CalcUren(NewTijdVan0, NewTijdTot0, NewPauze0.checked, NewTijd0)" type="checkbox" name="NewPauze0"></td>
  147.                     <td><input onblur="UpdateTotal();" readOnly type="text" size="10" name="NewTijd0"></td>
  148.                 </tr>
  149.                 <tr>
  150.                     <td><input type="text" size="10" name="NewDatum1"></td>
  151.                     <td><input onblur="CalcUren(NewTijdVan1, NewTijdTot1, NewPauze1.checked, NewTijd1)" type="text" size="5" name="NewTijdVan1"></td>
  152.                     <td><input onblur="CalcUren(NewTijdVan1, NewTijdTot1, NewPauze1.checked, NewTijd1)" type="text" size="5" name="NewTijdTot1"></td>
  153.                     <td><input type="text" size="30" name="NewRelatie1"></td>
  154.                     <td align="middle"><input onclick="CalcUren(NewTijdVan1, NewTijdTot1, NewPauze1.checked, NewTijd1)" type="checkbox" name="NewPauze1"></td>
  155.                     <td><input onblur="UpdateTotal();" readOnly type="text" size="10" name="NewTijd1"></td>
  156.                 </tr>
  157.                 <tr>
  158.                     <td><input type="text" size="10" name="NewDatum2"></td>
  159.                     <td><input onblur="CalcUren(NewTijdVan2, NewTijdTot2, NewPauze2.checked, NewTijd2)" type="text" size="5" name="NewTijdVan2"></td>
  160.                     <td><input onblur="CalcUren(NewTijdVan2, NewTijdTot2, NewPauze2.checked, NewTijd2)" type="text" size="5" name="NewTijdTot2"></td>
  161.                     <td><input type="text" size="30" name="NewRelatie2"></td>
  162.                     <td align="middle"><input onclick="CalcUren(NewTijdVan2, NewTijdTot2, NewPauze2.checked, NewTijd2)" type="checkbox" name="NewPauze2"></td>
  163.                     <td><input onblur="UpdateTotal();" readOnly type="text" size="10" name="NewTijd2"></td>
  164.                 </tr>
  165.                 <tr>
  166.                     <td><input type="text" size="10" name="NewDatum3"></td>
  167.                     <td><input onblur="CalcUren(NewTijdVan3, NewTijdTot3, NewPauze3.checked, NewTijd3)" type="text" size="5" name="NewTijdVan3"></td>
  168.                     <td><input onblur="CalcUren(NewTijdVan3, NewTijdTot3, NewPauze3.checked, NewTijd3)" type="text" size="5" name="NewTijdTot3"></td>
  169.                     <td><input type="text" size="30" name="NewRelatie3"></td>
  170.                     <td align="middle"><input onclick="CalcUren(NewTijdVan3, NewTijdTot3, NewPauze3.checked, NewTijd3)" type="checkbox" name="NewPauze3"></td>
  171.                     <td><input onblur="UpdateTotal();" readOnly type="text" size="10" name="NewTijd3"></td>
  172.                 </tr>
  173.                 <tr>
  174.                     <td><input type="text" size="10" name="NewDatum4"></td>
  175.                     <td><input onblur="CalcUren(NewTijdVan4, NewTijdTot4, NewPauze4.checked, NewTijd4)" type="text" size="5" name="NewTijdVan4"></td>
  176.                     <td><input onblur="CalcUren(NewTijdVan4, NewTijdTot4, NewPauze4.checked, NewTijd4)" type="text" size="5" name="NewTijdTot4"></td>
  177.                     <td><input type="text" size="30" name="NewRelatie4"></td>
  178.                     <td align="middle"><input onclick="CalcUren(NewTijdVan4, NewTijdTot4, NewPauze4.checked, NewTijd4)" type="checkbox" name="NewPauze4"></td>
  179.                     <td><input onblur="UpdateTotal();" readOnly type="text" size="10" name="NewTijd4"></td>
  180.                 </tr>
  181.                 <tr>
  182.                     <td align="right" colSpan="5">Totaal Tijd:
  183.                     </td>
  184.                     <td><input name="txtTotaalTijd" type="text" value="0" readonly="readonly" id="txtTotaalTijd" size="10" /></td>
  185.                 </tr>
  186.             </table>
  187.             <br>
  188.             <table width="728">
  189.                 <tr>
  190.                     <td style="WIDTH: 334px" align="right"></td>
  191.                     <td align="right"><input type="image" name="btnSave" id="btnSave" tabindex="24" src="images\opslaan.gif" alt="" border="0" /></td>
  192.                     <td align="right"><input type="image" name="btnSavePrint" id="btnSavePrint" tabindex="25" src="images\VZprintenopslaan.gif" alt="" border="0" /></td>
  193.                 </tr>
  194.             </table>
  195.         </form>
  196.     </body>
  197. </HTML>
  198.  
Oct 15 '08 #10

acoder
Expert Mod 15k+
P: 16,027
From what I can see, the latest code that you posted should work because the name of the form matches the name you're trying to access with using JavaScript.

Note the name of the form: OverurenDecl. If you rename the form "ct100" in the page that has the error to "OverurenDecl", then it should also work.
Oct 15 '08 #11

P: 72
okey so if you look at the code i posted on my first post id aksuly shud work

if you dont have any other solutions i have a qustion about VS 7 and 2005 becase i think the error is being created becase i converted the project 2005 and thats the only problem there is so than i maybe can start focusing on the thing that has changed in those version and then i maybe no how to change it
Oct 15 '08 #12

acoder
Expert Mod 15k+
P: 16,027
I'm not sure if the versions of Visual Studio make a difference.

If the online version is working, but the offline one isn't, look at the differences between the two. Note, for example, that in post #6 the form name is "ct100" (not working) while in post #10, it's called "OverurenDecl" (working).
Oct 15 '08 #13

P: 72
I still have 1 question if you cud help me with finding a span id name becase i cant find a name anywhere not in my code from the project or in the client version of it if i use a span id were whud the name of it be written
Oct 15 '08 #14

acoder
Expert Mod 15k+
P: 16,027
I notice in your code, you have:
Expand|Select|Wrap|Line Numbers
  1. <span id="TableSpan">
Is that the span you're referring to?
Oct 15 '08 #15

P: 72
nop srry it whas from another bit of code from another file becase i have that error on 10 pages all the same error code but tnx anyway
Oct 15 '08 #16

acoder
Expert Mod 15k+
P: 16,027
Which error message? The one in the thread title?

The reason as far as I can see is the same. You need to rename the form.
Oct 15 '08 #17

P: 72
well you are partle right allrydi so i think your complete right i had more errors in the project and now i have solved 2 by changeing the body onloud code into the code i get from the client version of that page but i whas trying to do it on other pages ass wel bt i dident work yet some errors are coused by txtbox and some by dropdownlist

but i will look some more and see if i still get any fother

Tnx for all your help so far
Oct 15 '08 #18

acoder
Expert Mod 15k+
P: 16,027
The best and easiest way is to be consistent in naming and referring to form elements. Use the same name if you're going to reuse the code in other pages.
Oct 15 '08 #19

P: 72
Hey i have 1 question about this project

becase in my project i use a coulpe of JavaScripts and these have the same naming as my documents first had so my question whas if you know i need to change all those name spaces in JS 2

so its about the code of
document.Verzamelblad.txtKlantNaam
document.............txtKlantNaam

the place were i have the ............ i need to put the name of my form
Oct 17 '08 #20

acoder
Expert Mod 15k+
P: 16,027
You can use document.forms[str].elem where str would be a variable containing the name of the form.
Oct 17 '08 #21

P: 72
I finaly got all the stuff 2 work i need to use ct100 as form name tnx for all your help cudent have done it without it
Oct 20 '08 #22

acoder
Expert Mod 15k+
P: 16,027
Well done. Glad you got it working :)
Oct 20 '08 #23

P: 72
Pleas delete this post becase there is some tekt in the code that i whant to have deleted Pleas
Nov 13 '08 #24

acoder
Expert Mod 15k+
P: 16,027
I assume you meant post #10. I've removed the names from the post. Be careful in future about sensitive information when posting code.

Moderator.
Nov 13 '08 #25

P: 72
Moderator pleas delete this post Becase there are names in it that can be found by google
Nov 19 '08 #26

acoder
Expert Mod 15k+
P: 16,027
Which post? The one which had names I've replaced with asterisks. See post #10 lines 72-81.
Nov 19 '08 #27

Post your reply

Sign in to post your reply or Sign up for a free account.