validators and javascript(confirm)
-
hi i have a button in my page and add this attribute to button <javascript:return confirm('Message');")>> and also i have a textbox in my page that a requirefiledvalidator check that not be empty. if i click button confirm occur for me and if i press <> the code of this event execute while textbox is empty and validator not check the textbox. when event onclick of button finished validator check the textbox. please help me thanks a lot.
-
hi i have a button in my page and add this attribute to button <javascript:return confirm('Message');")>> and also i have a textbox in my page that a requirefiledvalidator check that not be empty. if i click button confirm occur for me and if i press <> the code of this event execute while textbox is empty and validator not check the textbox. when event onclick of button finished validator check the textbox. please help me thanks a lot.
Hi there, You didn't say what you want to do in this case? If you want not to execute the event handler in the code behind when you click OK, then you simply remove the
return
keyword in your sample script. If you want the validator not to validate when the OK is clicked, then in the event handler of the button you simply set theIsValid
of the validator totrue
. -
Hi there, You didn't say what you want to do in this case? If you want not to execute the event handler in the code behind when you click OK, then you simply remove the
return
keyword in your sample script. If you want the validator not to validate when the OK is clicked, then in the event handler of the button you simply set theIsValid
of the validator totrue
.hi minhpc_bk, thank a lot, i want have a confirm in bottun click, when i click <> in confirm window the validator validate the textbox and if textbox not empty, execute the event handler in the code behind. but now if textbox is empty after click <> the event handler in the code behind execute. thanks bye
-
hi minhpc_bk, thank a lot, i want have a confirm in bottun click, when i click <> in confirm window the validator validate the textbox and if textbox not empty, execute the event handler in the code behind. but now if textbox is empty after click <> the event handler in the code behind execute. thanks bye