Welcome Guest Search | Active Topics | Sign In | Register

disable button on dialog with javascript Options
Philo
Posted: Monday, March 29, 2010 7:09:52 PM
Rank: Member
Groups: Member

Joined: 2/24/2010
Posts: 10
I have a conformation dialog, but the accept button depends of a grid, if any item of the grid is checked the button on accept button dialog is enabled in another case the button is disabled, i can determine if any item on the grid is selected but can i disabled the accept button with javascript o any other method.

Thanks a lot.
eo_support
Posted: Monday, March 29, 2010 7:20:24 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

In that case you should use a regular button instead of "AcceptButton". A regular button is just a button or whatever you placed insided the dialog. The only relationship between the button and the dialog is it sits inside the dialog. You can enable/disable it as you wish and it would has nothing to do with the dialog. If the button is a server side asp:Button, then clicking the button automatically posts back the page, thus closing the dialog. If the button is a HTML button, then you will need to handle the button's click event with JavaScript. Inside the event handler you can close the dialog with the following code:

Code: JavaScript
eo_GetObject("Dialog1").close();


An “accept button” is slightly different. The dialog will automatically intercept the accept button’s click event and close the dialog when the button is clicked. You would specify an accept button by setting the dialog’s AcceptButton property to the ID of the button.

Thanks!
Philo
Posted: Tuesday, March 30, 2010 10:04:38 AM
Rank: Member
Groups: Member

Joined: 2/24/2010
Posts: 10
thanks.

I have create a html button and i build the message dialog before the dialog show. thanls again.
eo_support
Posted: Tuesday, March 30, 2010 10:07:15 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
You are very welcome. Glad that it works for you.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.