This is a migrated thread and some comments may be shown as answers.

Validation Using Tool tip

1 Answer 140 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Azees
Top achievements
Rank 1
Azees asked on 11 Sep 2008, 07:18 AM


I am using validation control in my web application for registraion form

I am having one Problem with My Coding When i Click submit button..
When validation summary show if it having errors..Its working Properly....
But when i refresh Page with errors  Onclient click doesnot call...
automatically call to onclick event (server Side) even validation summary having
Error...
how to i solve it  i put my code below





<

telerik:RadToolTip runat="server" ID="RadToolTip10"

Position="Center"

RelativeTo="Element"

ManualClose="true"

OnClientBeforeShow="CheckIfShow"

TargetControlId="btnSubmit" Skin="Web20"

Title="You have following Errors" Modal="true" MouseTrailing="true">

<table cellpadding="0" cellspacing="0" width="300"><tr><td></td><td>

<asp:ValidationSummary id="ValidationSummary1" runat="server"/></td></tr>

<tr><td></td><td align="right"><asp:Button ID="btnClose" runat="server" Text="Close" OnClientClick="HideTooltip()" />

</td></tr></table>

</telerik:RadToolTip>



SUBMIT BUTTON

<

asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClientClick="ShowTooltip();" OnClick="btnSubmit_Click" />

Java Script:

function

ShowTooltip()

{

window.setTimeout(

function()

{

var tooltip = $find("<%=RadToolTip10.ClientID %>");

//API: show the tooltip

tooltip.show();

}, 10);

}

function CheckIfShow(sender, args)

{

var summaryElem = document.getElementById("<%=ValidationSummary1.ClientID %>");

//check if summary is visible

if (summaryElem.style.display == "none")

{

//API: if there are no errors, do not show the tooltip

args.set_cancel(

true);

}

}

function HideTooltip()

{

var tooltip = $find("<%=RadToolTip10.ClientID %>");

//API: hide the tooltip

tooltip.hide();

}

Regards

Friend        

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 15 Sep 2008, 01:02 PM
Hello Azees,

The problem is not directly related to RadControls but to general ASP.NET knowledge.

Please, put the ValidationSummary control outside the RadToolTip control and you will experience the same problem. After you build your logic without the RadToolTip control you should not experience problems when putting the summary back in  the tooltip.

Sincerely yours,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ToolTip
Asked by
Azees
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or