I have tons of textboxes and datepickers. I tried pointing the IDs of the datepickers to the target input of Textboxsettings for required field validation but it seems it does not work.
I know that I can use a normal asp.net validation but I like the way textboxsetting shows the validation message inside the textbox which is not (straightforward) possible in a normal asp.net validation control.
5 Answers, 1 is accepted
0
Web team
Top achievements
Rank 1
answered on 13 May 2010, 04:44 AM
i am currently trying using multiple textboxes using shared datepickers as shown in the demos, hopefully it will work. My question is where can I get the datepicker image as i will explicitly set the path of the image? Thanks.
0
Hi Arnold,
RadInputManager has been designed to work with regular asp:TextBoxes, not RadDatePickers or RadTextBoxes.
You can either use a non-embedded popup image as in this online demo...
http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/shareddatepicker/defaultcs.aspx
...or you can use an embedded image like this:
<asp:Button ID="Button1" runat="server" class="popupButton" />
<telerik:RadCodeBlock ID="asdf" runat="server">
<style type="text/css">
.popupButton
{
border:0;
padding:0;
width:22px;
height:22px;
background:transparent no-repeat 0 0 url(<%= Page.ClientScript.GetWebResourceUrl(typeof(RadCalendar), "Telerik.Web.UI.Skins.Sunset.Calendar.sprite.gif") %>);
}
</style>
</telerik:RadCodeBlock>
The above CSS code should be placed in the <head> of the page.
Regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
RadInputManager has been designed to work with regular asp:TextBoxes, not RadDatePickers or RadTextBoxes.
You can either use a non-embedded popup image as in this online demo...
http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/shareddatepicker/defaultcs.aspx
...or you can use an embedded image like this:
<asp:Button ID="Button1" runat="server" class="popupButton" />
<telerik:RadCodeBlock ID="asdf" runat="server">
<style type="text/css">
.popupButton
{
border:0;
padding:0;
width:22px;
height:22px;
background:transparent no-repeat 0 0 url(<%= Page.ClientScript.GetWebResourceUrl(typeof(RadCalendar), "Telerik.Web.UI.Skins.Sunset.Calendar.sprite.gif") %>);
}
</style>
</telerik:RadCodeBlock>
The above CSS code should be placed in the <head> of the page.
Regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Web team
Top achievements
Rank 1
answered on 13 May 2010, 08:20 AM
i used the shared datepicker (like in the demo) then I point the custom textboxes to the textboxsettings. when i select a date by clicking the textbox, the textbox css changes to look like it is active. the font color in the textbox is black. however, when i select a date using the image of the datepicker the textbox of the css doesnt change and it look like inactive - font is gray. please see attach pic.
0
Accepted
Hello Arnold,
The problem is in the way you are setting the textbox value - the RadInputManager doesn't know about this, so it doesn't update the textbox styles. Please either set the value using the RadInputManager API or refresh the textbox styles manually.
Kind regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
The problem is in the way you are setting the textbox value - the RadInputManager doesn't know about this, so it doesn't update the textbox styles. Please either set the value using the RadInputManager API or refresh the textbox styles manually.
<
telerik:RadInputManager
ID
=
"RadInputManager1"
runat
=
"server"
>
<
telerik:DateInputSetting
EmptyMessage
=
"empty"
>
<
TargetControls
>
<
telerik:TargetInput
ControlID
=
"TextBox1"
/>
</
TargetControls
>
</
telerik:DateInputSetting
>
</
telerik:RadInputManager
>
<
asp:TextBox
ID
=
"TextBox1"
runat
=
"server"
/>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"set date value"
OnClientClick
=
"return setv()"
/>
<
script
type
=
"text/javascript"
>
function setv()
{
//use this
$find("<%= RadInputManager1.ClientID %>").get_targetInput("<%= TextBox1.ClientID %>").set_value("5/5/2010");
//or this
//$get("TextBox1").value = "5/5/2010";
//$find("<%= RadInputManager1.ClientID %>").get_targetInput("<%= TextBox1.ClientID %>").updateCssClass();
return false;
}
</
script
>
Kind regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Web team
Top achievements
Rank 1
answered on 13 May 2010, 09:24 AM
that works thanks!