473,513 Members | 2,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

avoid click OK button twice to close a dialog

HI,
I have a dialog (window) with a drop-down list and an OK button. When
user clicks the drop-down list, the app need to do some calculation and
validation, so I put an Text_on_change event on the drop-down. When
click OK the dialog should be closed; however, if the user already
clicked the drop-down, he needs to click OK button twice to close the
window. After a little research I found out the once the focus is moved
out the drop-down list control, the Text_on_change event is triggered,
and this event has higher priority than 'OK button clicked' event. So
the first click the server will not see the 'OK button clicked' event.
I found a solution to move all calcuation and validation to client side
and rewrite them in javascript. Although is can work, it is extremly
annoying to mix the logic with client side java script.
I wonder if anybody have a better solution to this porblem?
Thanks
Danny
Nov 18 '05 #1
2 2676
The focus change shouldnt trigger a SelectedIndexChange event. There must be
something else going on.

According to me, there is nothing wrong in having client side and as well
serverside code.

Sekhar.

"Danny Wang" <d_****@hotmail.com> wrote in message
news:uT*************@TK2MSFTNGP12.phx.gbl...
HI,
I have a dialog (window) with a drop-down list and an OK button. When
user clicks the drop-down list, the app need to do some calculation and
validation, so I put an Text_on_change event on the drop-down. When
click OK the dialog should be closed; however, if the user already
clicked the drop-down, he needs to click OK button twice to close the
window. After a little research I found out the once the focus is moved
out the drop-down list control, the Text_on_change event is triggered,
and this event has higher priority than 'OK button clicked' event. So
the first click the server will not see the 'OK button clicked' event.
I found a solution to move all calcuation and validation to client side
and rewrite them in javascript. Although is can work, it is extremly
annoying to mix the logic with client side java script.
I wonder if anybody have a better solution to this porblem?
Thanks
Danny

Nov 18 '05 #2
There might be a mistake in my description:
THe drop-down should be a text input bar.
When user leave the text bar, the Text_on_Change associate with it is
trigger.

Danny

Chandra Sekhar wrote:
The focus change shouldnt trigger a SelectedIndexChange event. There must be
something else going on.

According to me, there is nothing wrong in having client side and as well
serverside code.

Sekhar.

"Danny Wang" <d_****@hotmail.com> wrote in message
news:uT*************@TK2MSFTNGP12.phx.gbl...
HI,
I have a dialog (window) with a drop-down list and an OK button. When
user clicks the drop-down list, the app need to do some calculation and
validation, so I put an Text_on_change event on the drop-down. When
click OK the dialog should be closed; however, if the user already
clicked the drop-down, he needs to click OK button twice to close the
window. After a little research I found out the once the focus is moved
out the drop-down list control, the Text_on_change event is triggered,
and this event has higher priority than 'OK button clicked' event. So
the first click the server will not see the 'OK button clicked' event.
I found a solution to move all calcuation and validation to client side
and rewrite them in javascript. Although is can work, it is extremly
annoying to mix the logic with client side java script.
I wonder if anybody have a better solution to this porblem?
Thanks
Danny


Nov 18 '05 #3

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

Similar topics

6
2832
by: Michael Johnson Jr. | last post by:
I am trying to handle a button click event, which updates a web control table with data. The button is dynamically created in the table itself. When I call updateTable() in the Page_Load the new...
2
3390
by: Samy | last post by:
Hi There, I have a user control with buttons on it which I use on a aspx page (parent page). On a button click, a modal dialog(aspx page) opens up and the user enters some info in the modal dialog...
3
8715
by: Imran Aziz | last post by:
Hello All, I have a search text and button that post data and my button handler filters the repeater control. However when the button is clicked the first time. The page_load event is being called...
11
10985
by: Sarah | last post by:
I have code that I want to run so that if the result is true, it changes the current button's ".DialogResult" property to "DialogResult.OK". Problem is, when I run this code on the ".Click" event...
4
4058
by: Ian Davies | last post by:
Hello I am struggling for a solution to clear some fields on my webpage that takes their values from some sessions My solution below works when the button is clicked twice. I sort of know why I...
3
11915
by: Gallarpri | last post by:
Hi, I'm making a dialog form with a textbox and 2 buttons: OK and Cancel. I want when I click on OK button, the program check the textbox, and if there is any error in the text introduced there,...
0
3749
by: aarthiraaj | last post by:
In my user screen I have view link, if I click this link it will go to servlet and open one word document. It is opening properly, but while opening the attachment it generate one dialog box like...
2
3229
by: =?Utf-8?B?SGV6YWw=?= | last post by:
Hi, I am trying to add a new record to a table but everytime I click the button, somehow it saves the record twice... I've created a stored procedure to insert records into a table and I called...
1
1023
by: bhappy | last post by:
Hi I want to close a modeless dialog window on the click of submit button .During click of submit button i am saving data to database and Postback the data entered in child window to parent...
0
7254
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,...
0
7373
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,...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7094
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...
1
5079
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...
0
3230
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...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1585
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 ...
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.