I'm learning web development in .NET (coming from windows only programming in VB 6.0) and there appears to be a problem with the code in the book i'm using. The problem is, I've added a web control called txtName to the form and from within javascript, I reference it with this code:
alert(document.Form1.txtName.Value)
The problem is: 1. txtName doesn't show up as an object when I start typing this and 2. When the message box pops up when i view the project in the browser it simply says "undefined"
If I remove the web control and use an HTML control, it shows up under document.Form1.txtName2 (that's the name I used for it) but when I put alert(document.Form1.txtName2.InnerText) the prompt is blank.
What is missing here that is not letting the form be "aware" of this web control???? Thanks in advance. If you need the code I can post it but I'm guessing it's something simple.
alert(document.Form1.txtName.Value)
The problem is: 1. txtName doesn't show up as an object when I start typing this and 2. When the message box pops up when i view the project in the browser it simply says "undefined"
If I remove the web control and use an HTML control, it shows up under document.Form1.txtName2 (that's the name I used for it) but when I put alert(document.Form1.txtName2.InnerText) the prompt is blank.
What is missing here that is not letting the form be "aware" of this web control???? Thanks in advance. If you need the code I can post it but I'm guessing it's something simple.