aibar
asked on
Cannot get TextChanged event to fire
Using Visual Studio, vb.net: I need to have a text box fill in dynamically without page postback either of two other text boxes change in value. I have tried using the change event in code-behind for the text boxes and I've tried using javascript in the HTML, all to no avail. Any suggestions or points to help would be welcome!!
ASKER
I have three text boxes. When text box #1 or #2 changes in value, I need text box #3 to change in value. So simple, and I knew how to do it before in regular ASP, but for the life of me cannot do it now?! Thank you for any help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect! Works perfectly and I've learned a lot from this little snippet you gave. Thanks!
Glad it was of help! :)
I just re-read my post, and my comment in the last sentence was of course wrong. The values of TextBox1 & TextBox2 will also be submitted along with the rest of the form data when you do a postback, since they're both input elements (even if they aren't marked as runat="server"). But for practical intents and purposes it doesn't matter a whole lot.
I just re-read my post, and my comment in the last sentence was of course wrong. The values of TextBox1 & TextBox2 will also be submitted along with the rest of the form data when you do a postback, since they're both input elements (even if they aren't marked as runat="server"). But for practical intents and purposes it doesn't matter a whole lot.
ASKER
One more note - I got an error when I first ran it that I had an illegal character. Removing the first ";" from this line:
var textbox3ID="<% Response.Write(TextBox3.Cl ientID); %>";
solved the problem. Thanks again!
var textbox3ID="<% Response.Write(TextBox3.Cl
solved the problem. Thanks again!
I see, it must be because you're using VBScript instead of C#. In C# the ; would be required, but in VB it is invalid.
Take care!
Take care!
You should be able to use javascript on the client. Can you give us an idea of exactly what needs to happen and when ?