I've got a problem with the ClientEvents-OnFocus of RadTextBox.
The scenario is:
In the RadTextBox I've a text with a ForeColor, when the user click in the textbox (ClientEvents OnFocus) a javascript function delete the text and change the ForeColor of the textbox, but when I test the page the browser notify me that there's an error in the page. The error is with the registration of the js call on the page:
<
telerik:RadTextBox ID="txtComuneBene" runat="server" Width="350px" AutoPostBack="true" ClientEvents-OnFocus="javascript:setControlFocus('txtComuneBene');">
</telerik:RadTextBox>
I also tried with :
<telerik:RadTextBox ID="txtComuneBene" runat="server" Width="350px" ClientEvents-OnFocus="javascript:setControlFocus('txtComuneBene');">
</telerik:RadTextBox>
and
<telerik:RadTextBox ID="txtComuneBene" runat="server" Width="350px" ClientEvents-OnFocus="setControlFocus('txtComuneBene');">
</telerik:RadTextBox>
and
<telerik:RadTextBox ID="txtComuneBene" runat="server" Width="350px" ClientEvents-OnFocus="setControlFocus('txtComuneBene')">
</telerik:RadTextBox>
and finally I try with a js alert to test if I write something wrong but the result is always the same.
<telerik:RadTextBox ID="txtComuneBene" runat="server" Width="350px" ClientEvents-OnFocus="alert('test alert');">
</telerik:RadTextBox>
a js error with this message :
Message: Expected '}'
And this is the ajax registration ( the problem is the italic style text):
Sys.Application.add_init(
function() {
$create(Telerik.Web.UI.RadTextBox, {
"_focused":false,"_postBackEventReferenceScript":"setTimeout(\"__doPostBack(\\\u0027ctl00$MainContent$ucRichiestaServizio$txtComuneBene\\\u0027,\\\u0027\\\u0027)\", 0)","_skin":"Default","clientStateFieldID":"ctl00_MainContent_ucRichiestaServizio_txtComuneBene_ClientState","enabled":true,"styles":{HoveredStyle: ["width:350px;", "riTextBox riHover"],InvalidStyle: ["width:350px;", "riTextBox riError"],DisabledStyle: ["width:350px;", "riTextBox riDisabled"],FocusedStyle: ["width:350px;", "riTextBox riFocused"],EmptyMessageStyle: ["width:350px;", "riTextBox riEmpty"],ReadOnlyStyle: ["width:350px;", "riTextBox riRead"],EnabledStyle: ["width:350px;", "riTextBox riEnabled"]}}, {"focus":javascript:setControlFocus('txtComuneBene');}, null, $get("ctl00_MainContent_ucRichiestaServizio_txtComuneBene"));
});
any ideas?
another question :
I've got a page with a RadWindowManager that shows a confirm window, if I click on the "Ok" button the page is refreshed with a complete postback, is there a way to avoid this complete postback? I register in the RadAjaxManager that the RadWindowManager has to refresh a panel inside the page with the RadAjaxLoadingPanel that I have in the page.
thanks in advance,
regards
Alessandro