Good day.
I try use Client Side of RadTextBox. I need take text from one radtextbox, do changes and set new text into the second radtextbox during user press any key in the first radtextbox.
But behavior is little strange. I use get_value and set_value methods to get and set text from/into radtextbox.
But first, I can't take full text from textbox (last symbol is always missing)
Second, set_value doesn't always update text into radtextbox.
Third, it causes validation error.
Could you please advise how I can make it?
Thanks.
P.S. I can't attach zip file, so I've inserted my code below
I try use Client Side of RadTextBox. I need take text from one radtextbox, do changes and set new text into the second radtextbox during user press any key in the first radtextbox.
But behavior is little strange. I use get_value and set_value methods to get and set text from/into radtextbox.
But first, I can't take full text from textbox (last symbol is always missing)
Second, set_value doesn't always update text into radtextbox.
Third, it causes validation error.
Could you please advise how I can make it?
Thanks.
P.S. I can't attach zip file, so I've inserted my code below
<
telerik:RadCodeBlock
ID
=
"dfg"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function KeyPress(s, e) {
var v = s.get_value();
var l = v.replace(',','');
var ctrl = $find("<%=txtSecond.ClientID %>");
ctrl.set_value(l);
}
</
script
>
</
telerik:RadCodeBlock
>
<
div
>
Enter some text here <
telerik:RadTextBox
ID
=
"txtFirst"
runat
=
"server"
EmptyMessage
=
"Message"
>
<
ClientEvents
OnKeyPress
=
"KeyPress"
/>
</
telerik:RadTextBox
>
<
asp:RequiredFieldValidator
ID
=
"wer"
runat
=
"server"
ControlToValidate
=
"txtFirst"
ErrorMessage
=
"*"
ForeColor
=
"Red"
ValidationGroup
=
"gr" SetFocusOnError="true"
></
asp:RequiredFieldValidator
>
<
br
/><
br
/>
Enter some text here <
telerik:RadTextBox
ID
=
"txtSecond"
runat
=
"server"
EmptyMessage
=
"Message"
>
</
telerik:RadTextBox
>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator1"
runat
=
"server"
ControlToValidate
=
"txtSecond"
ErrorMessage
=
"*"
ForeColor
=
"Red"
ValidationGroup
=
"gr" SetFocusOnError="true"
></
asp:RequiredFieldValidator
>
<
br
/><
br
/>
<
telerik:RadButton
ID
=
"btnPostBack"
runat
=
"server"
Text
=
"Postback"
ValidationGroup
=
"gr"
></
telerik:RadButton
>
</
div
>