avoid click OK button twice to close a dialog

  • Thread starter Thread starter Danny Wang
  • Start date Start date
D

Danny Wang

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
 
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.
 
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
 
Back
Top