Welcome Guest Search | Active Topics | Sign In | Register

Toolbar and RequiredFieldValidator Options
Mark W
Posted: Tuesday, February 22, 2011 8:07:00 AM
Rank: Member
Groups: Member

Joined: 2/6/2010
Posts: 22
Hi
I have the toolbar set to
AutoPostBack="true"

but when I click a button the tool bar it doen't set off the RequiredFieldValidator.
If I place a asp button on the page it works, just not when I click the button on the toolbar.

Any Ideas
Many Thanks

Mark
eo_support
Posted: Tuesday, February 22, 2011 8:52:35 AM
Rank: Administration
Groups: Administration

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

Thanks for the information. I have confirmed that the ToolBar control currently does not trigger validation. We will look into it and see if we can add that.

Thanks!
Mark W
Posted: Tuesday, February 22, 2011 9:19:57 AM
Rank: Member
Groups: Member

Joined: 2/6/2010
Posts: 22
Hi
Thanks for the update.

Should I be able to add a custom item to the toolbar, say a <asp:Button
then use that for the validation.

Been looking into this but can't quite get it to add, but i'm still looking!
Many Thanks

Mark
Mark W
Posted: Tuesday, February 22, 2011 9:47:38 AM
Rank: Member
Groups: Member

Joined: 2/6/2010
Posts: 22
Hi this seems to work!

<eo:ToolBarItem Type="Custom">
<CustomItem>
<asp:Button ID="Button2" runat="server" Text="Button" /></CustomItem>
</eo:ToolBarItem>
eo_support
Posted: Tuesday, February 22, 2011 10:20:20 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Cool. Glad that it works for you!
Mark W
Posted: Tuesday, February 22, 2011 10:25:43 AM
Rank: Member
Groups: Member

Joined: 2/6/2010
Posts: 22
Hi again

It worked in that it makes the validation work, but then doesn't do a postback if it a <CustomItem>
once the validation is meet.

any ideas?

Many Thanks

Mark
eo_support
Posted: Tuesday, February 22, 2011 12:13:17 PM
Rank: Administration
Groups: Administration

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

Please try the following code:

Code: HTML/ASPX
<eo:ToolBar ClientSideOnItemClick="toolbar_click_handler" ...>
....
</eo:ToolBar>


Code: JavaScript
function toolbar_click_handler()
{
    //Returns false to cancel AutoPostBack if validation failed
    if (!Page_ClientValidate())
        return false;
}


Thanks!
Mark W
Posted: Wednesday, February 23, 2011 7:09:09 AM
Rank: Member
Groups: Member

Joined: 2/6/2010
Posts: 22
many thanks support.
Thats all working now.


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.