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

value from dropdownlist to txtbox when you enterd a sign in txtbox

P: 72
Hey mensen

I am having some big troubles here i tryd solving it myself with internet for 2 days but i kind fix it.
Its about this i have a DotNet project that alrydi is online and working for almost everything.
but it whas made in Visual Studio 7 and i converted it to 2005. in version 7 it works almost perfect but in 2005 i am having some errors.

becase all the code i am using is very long i am trying to post the nesecery code only if you need more just tell me

The ERROR is this: Runtime-fout Microsoft JScript: 'document.WerkbonOverzicht.txtKlant1' is empty or not ann object

the thing i whant to make work again is this: i have 1 Textbox and 1 Dropdownlist and the dropdownlist gets information from a database with a lot of names.
the thing i whanne get to work again is that if i typ a letter in my txtbox it gets the name from the dropdownlist.
All the programmig code is good becase it works in the online version. and the error points at the end of the document after </html>
i personly thin the error is somewere in the 2 rules of body onloud and form id tag.

this whas the code in Visual Studio 7 working online

WerkbonOverzicht.aspx

Expand|Select|Wrap|Line Numbers
  1. <%@ Page language="c#" Codebehind="WerkbonOverzicht.aspx.cs" AutoEventWireup="false" Inherits="DotNet.WerkbonOverzicht" debug="False"%>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  3. <HTML>
  4.     <HEAD>
  5.         <LINK href="style.css" type="text/css" rel="stylesheet">
  6.             <script language="javascript" src="AlgemeneFuncties.js"></script>
  7.     </HEAD>
  8.     <body onload="InitCombobox(document.WerkbonOverzicht.txtKlant1, document.WerkbonOverzicht.DDLKlant1);">
  9.         <form id="WerkbonOverzicht" method="post" runat="server">
  10.             <P>
  11.                 <asp:Button id="btnNada" runat="server" Width="1px" BorderColor="#567C9C" BackColor="#567C9C" BorderStyle="None" Height="1px"></asp:Button><asp:dropdownlist id="DDLKlant1" runat="server" AutoPostBack="True" Width="246px"></asp:dropdownlist></P>
  12.             <P><asp:imagebutton id="imgbtnToevoegen" onfocus="this.blur()" runat="server" ImageUrl="images\toevoegen.gif" DESIGNTIMEDRAGDROP="30"></asp:imagebutton></P>
  13.             <P><asp:button id="btnReset" runat="server" BorderColor="Red" BackColor="Red" Text="Reset"></asp:button></TD></P>
  14.             <P>
  15.                 <table cellSpacing="1" cellPadding="0" width="70%">
  16.                     <tr>
  17.                         <td>Jaar:</td>
  18.                         <td>Klant:</td>
  19.                         <td>Werknemer:</td>
  20.                         <td>Aantal rijen:</td>
  21.                         <td>Datum:</td>
  22.                     </tr>
  23.                     <tr>
  24.                         <td><asp:dropdownlist id="DDLJaartal1" runat="server" AutoPostBack="True"></asp:dropdownlist></td>
  25.                         <td><asp:textbox id="txtKlant1" runat="server" Width="247px"></asp:textbox></td>
  26.                         <td><asp:dropdownlist id="DDLWerkn1" runat="server" AutoPostBack="True"></asp:dropdownlist></td>
  27.                         <td><asp:dropdownlist id="DDLRecord1" runat="server" AutoPostBack="True" Width="90px"></asp:dropdownlist></td>
  28.                         <td><asp:dropdownlist id="DDLDesc1" runat="server" AutoPostBack="True"></asp:dropdownlist></td>
  29.                     </tr>
  30.                 </table>
  31.             </P>
  32.             <table cellSpacing="1" cellPadding="0" width="90%">
  33.                 <tr>
  34.                     <th>
  35.                         ID</th>
  36.                     <th>
  37.                         Naam klant</th>
  38.                     <th>
  39.                         Datum</th>
  40.                     <th>
  41.                         Medewerker</th>
  42.                     <th>
  43.                         Omschrijving</th>
  44.                     <th>
  45.                         Uren</th>
  46.                     <th>
  47.                         Factuur</th></tr>
  48.                 <span id="TableSpan" runat="server"></span>
  49.                 <tr>
  50.                     <td colSpan="6">&nbsp;</td>
  51.                 </tr>
  52.             </table>
  53.         </form>
  54.     </body>
  55. </HTML>
  56.  
this is my current code in 2005 not working

WerkbonOverzicht.aspx

Expand|Select|Wrap|Line Numbers
  1. <%@ Page language="c#" Inherits="DotNet.WerkbonOverzicht" debug="False" CodeFile="WerkbonOverzicht.aspx.cs" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  3. <HTML>
  4.     <HEAD>
  5.         <LINK href="style.css" type="text/css" rel="stylesheet">
  6.             <script language="javascript" src="AlgemeneFuncties.js"></script>
  7.     </HEAD>
  8.     <body onload="InitCombobox(document.span2.txtKlant1, document.span2.DDLKlant1);">
  9.         <form name="WerkbonOverzicht" method="post" action="WerkbonOverzicht.aspx" id="WerkbonOverzicht">
  10.             <P>
  11.                 <asp:Button id="btnNada" runat="server" Width="1px" BorderColor="#567C9C" BackColor="#567C9C" BorderStyle="None" Height="1px" onclick="btnNada_Click"></asp:Button><asp:dropdownlist id="DDLKlant1" runat="server" AutoPostBack="True" Width="246px" onselectedindexchanged="DDLKlant1_SelectedIndexChanged"></asp:dropdownlist></P>
  12.             <P><asp:imagebutton id="imgbtnToevoegen" onfocus="this.blur()" runat="server" ImageUrl="images\toevoegen.gif"></asp:imagebutton></P>
  13.             <P><asp:button id="btnReset" runat="server" BorderColor="Red" BackColor="Red" Text="Reset" onclick="btnReset_Click"></asp:button></P>
  14.             <P>
  15.                 <table cellSpacing="1" cellPadding="0" width="70%">
  16.                     <tr>
  17.                         <td>Jaar:</td>
  18.                         <td>Klant:</td>
  19.                         <td>Werknemer:</td>
  20.                         <td>Aantal rijen:</td>
  21.                         <td>Datum:</td>
  22.                     </tr>
  23.                     <tr>
  24.                         <td><asp:dropdownlist id="DDLJaartal1" runat="server" AutoPostBack="True"></asp:dropdownlist></td>
  25.                         <td><asp:textbox id="txtKlant1" runat="server" AutoPostBack="True" Width="247px" ontextchanged="txtKlant1_TextChanged"></asp:textbox></td>
  26.                         <td><asp:dropdownlist id="DDLWerkn1" runat="server" AutoPostBack="True"></asp:dropdownlist></td>
  27.                         <td><asp:dropdownlist id="DDLRecord1" runat="server" AutoPostBack="True" Width="90px"></asp:dropdownlist></td>
  28.                         <td><asp:dropdownlist id="DDLDesc1" runat="server" AutoPostBack="True"></asp:dropdownlist></td>
  29.                     </tr>
  30.                 </table>
  31.             </P>
  32.             <table cellSpacing="1" cellPadding="0" width="90%">
  33.                 <tr>
  34.                     <th>
  35.                         ID</th>
  36.                     <th>
  37.                         Naam klant</th>
  38.                     <th>
  39.                         Datum</th>
  40.                     <th>
  41.                         Medewerker</th>
  42.                     <th>
  43.                         Omschrijving</th>
  44.                     <th>
  45.                         Uren</th>
  46.                     <th>
  47.                         Factuur</th></tr>
  48.                         <tr>
  49.                 <td><span id="TableSpan" runat="server"></span></td>
  50.                 </tr>
  51.                 <tr>
  52.                     <td colSpan="6">&nbsp;</td>
  53.                 </tr>
  54.             </table>
  55.         </form>
  56.     </body>
  57. </HTML>
I hope i posted it under the good forum questions

greets
Oct 13 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

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