473,771 Members | 2,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Textbox onchange won't fire after fill-in from popup window?

Hi, I have a textbox and a calendar popup window. I got this from a
posting (sorry, his name escapes me at the moment). It's nice and
simple, so I like it, of course.

Only problem I have is that when the popup closes and puts the control
value (date selected) into the textbox on my main form, I can't get my
onchnage event to fire (i.e., which should load a datagrid).

This is the sub that the calendar pop-up form uses when the date is
selected.

Protected Sub Change_Date(ByV al sender As System.Object, ByVal e As
System.EventArg s)
Dim strScript As String = "<script>window .opener.documen t.forms(0)." +
control.Value + ".value = '"
strScript += calDate.Selecte dDate.ToString( "MM/dd/yyyy")
strScript += "';self.close() "
strScript += "</" + "script>"
RegisterClientS criptBlock("any thing", strScript)
End Sub

I'm sure I'm missing something simple.

Thanks for any insights.

Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #1
1 6597
The OnChange event will not fire if the change is made from code...

What you could do, is call the OnChange event yourself, after setting the
new text in the textbox, passing (Nothing, Nothing) to the Sub
TextBox_OnTextC hanged(ByVal sender as Object, e as EventArgs)
Once returning to the main form (after pop-up closes itself) call teh
onchange event cause you know the text has changed, you just chagned it!
TextBox_OnTextC hange(Nothing, Nothing)


"Kathy Burke" <ka**********@a ttbi.com> wrote in message
news:ex******** ******@TK2MSFTN GP11.phx.gbl...
Hi, I have a textbox and a calendar popup window. I got this from a
posting (sorry, his name escapes me at the moment). It's nice and
simple, so I like it, of course.

Only problem I have is that when the popup closes and puts the control
value (date selected) into the textbox on my main form, I can't get my
onchnage event to fire (i.e., which should load a datagrid).

This is the sub that the calendar pop-up form uses when the date is
selected.

Protected Sub Change_Date(ByV al sender As System.Object, ByVal e As
System.EventArg s)
Dim strScript As String = "<script>window .opener.documen t.forms(0)." +
control.Value + ".value = '"
strScript += calDate.Selecte dDate.ToString( "MM/dd/yyyy")
strScript += "';self.close() "
strScript += "</" + "script>"
RegisterClientS criptBlock("any thing", strScript)
End Sub

I'm sure I'm missing something simple.

Thanks for any insights.

Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3227
by: James Howe | last post by:
I have a page which has a small number of input fields and some areas on the screen where the user can click to make things happen. These areas are generally <span>s with some associated onclick behavior. I want to have the onchange event fire when the user clicks on one of these areas. Is there a way that I can get this to happen? Thanks. -- James Howe
11
1724
by: Bob Bedford | last post by:
I'd like to fire a JS function from the Onchange event of a Text edit. Unfortunately it doesn't fire when I hit any key, but only when leaving the control. I've tried with OnKeyup, and it works, but it isn't compatible with NS6. Please any advice ? Best regards. Bob
7
2977
by: Hans | last post by:
Hi! Does anybody of you have a good algorithm to capture when a value in a textbox is changed? I'm using the keypress/keydown events but they seems to be a bit inconsistent (IE and Mozilla). Basically what I want is to set is a "isDirty" flag when a user has changed any value in the textbox (or in a dropdown) and then if he/she tries to leave the record without saving I want to give a save warning. Since I don't want set the isdirty flag...
4
31048
by: ms | last post by:
I have come across a problem where if a user enters the same text into a text input after the value has been programmatically changed, the onChange event does not fire for the second change. The following code demonstrates this: <html> <body> <input type=text value='yyy' onchange="this.value='xxx'"></input> <input type=text value='2'></input>
10
1920
by: Rob Nicholson | last post by:
In our application, we've added a bit of JavaScript that updates a title as the user types into a textbox. To trigger this, we patch into the "onkeyup" and "onpaste" events: FirstName.Attributes("onkeyup") = "ChangeTitle();" FirstName.Attributes("onpaste") = "ChangeTitle();" This works a treat but neither of these events fire if the user happens to enter a foreign character using the standard Windows ALT key plus numberic keypad, e.g....
1
4037
by: Steve | last post by:
hi all any body has any idea on how to fire onchange event of a pulldown menu with script. i need to trigger it so it when i select a certain option from script,the event handler is executed
1
1123
by: almurph | last post by:
Hi everyone, Is it possible to make a new events for a Web-form textbox. What I mean to ask is that I want an event to fire everytime a user enters a letter into a Web-form textbox. The only events that I see textbox has are: 1. DataBinding 2. Disposed 3. Init
2
2084
by: William Cole | last post by:
Here is my issue I have two text fields (Field A, Field B). I want Field B to be updated when Field A is changed. The problem is Field A is being changed through JavaScript so an onChange event is not fired. Is there any way to make this work without having to change the code that changes Field A? Thanks, William
2
13307
by: Joe Kovac | last post by:
Hi! Using: <asp:TextBox ID="TextBox1" runat="server" onchange="onchange()"></asp:TextBox> I get: Warning 1 Validation (ASP.Net): Attribute 'onchange' is not a valid
2
5734
by: daitasri | last post by:
Hi I m creating a textbox dynamically on click of a button. I want to attach an onChange event for that textbox.I tried using following code but it does not seem to work.Can anyone suggest a better way to solve my problem. The code i am using is as follows: var cell1 = row.insertCell(0); var addRowTextNode1 = document.createElement('input'); addRowTextNode1.setAttribute('type','text','name','UI'+iIteration,'id','UI'+iIteration);...
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9910
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.