4 Answers, 1 is accepted
0
Jayesh Goyani
Top achievements
Rank 2
answered on 29 Apr 2012, 07:19 AM
Hello Atchut,
Thanks,
Jayesh Goyani
<
telerik:GridTemplateColumn
>
<
ItemTemplate
>
<
telerik:RadTextBox
ID
=
"RadTextBox1"
runat
=
"server"
>
<
ClientEvents
OnValueChanging
=
"ValueChanged"
/>
</
telerik:RadTextBox
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
>
<
ItemTemplate
>
<
telerik:RadTextBox
ID
=
"RadTextBox2"
runat
=
"server"
>
</
telerik:RadTextBox
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<script type=
"text/javascript"
>
function
ValueChanged(sender, args) {
var
senderid = sender.get_id();
var
strtext = $find(senderid).get_value();
var
txt2 = $find(senderid.replace(
'RadTextBox1'
,
'RadTextBox2'
));
if
(strtext.length > 0) {
txt2.set_enabled(
false
);
}
else
{
txt2.set_enabled(
true
);
}
}
</script>
Thanks,
Jayesh Goyani
0
Atchut
Top achievements
Rank 1
answered on 29 Apr 2012, 07:23 PM
Hello Jayesh,
Thanks for your response. The script is working but still I am able to enter text into disbaled textbox.
What would be the reason?
Thanks for your response. The script is working but still I am able to enter text into disbaled textbox.
What would be the reason?
0
Atchut
Top achievements
Rank 1
answered on 29 Apr 2012, 07:25 PM
Hello Jayesh,
It is because tab is moving to next textbox. I have to disable that tab also.
It is because tab is moving to next textbox. I have to disable that tab also.
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 30 Apr 2012, 06:36 AM
Hello,
Thanks,
Jayesh Goyani
<
telerik:GridTemplateColumn
>
<
ItemTemplate
>
<
telerik:RadTextBox
ID
=
"RadTextBox1"
runat
=
"server"
>
<
ClientEvents
OnValueChanging
=
"ValueChanged"
/>
</
telerik:RadTextBox
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
>
<
ItemTemplate
>
<
telerik:RadTextBox
ID
=
"RadTextBox2"
runat
=
"server"
>
<
ClientEvents
OnKeyPress
=
"KeyPres"
/>
</
telerik:RadTextBox
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
function
ValueChanged(sender, args) {
var
senderid = sender.get_id();
var
strtext = $find(senderid).get_value();
var
txt2 = $find(senderid.replace(
'RadTextBox1'
,
'RadTextBox2'
));
if
(strtext.length > 0) {
txt2.set_enabled(
false
);
}
else
{
txt2.set_enabled(
true
);
}
}
function
KeyPres(sender, arge) {
if
(sender.get_enabled() ==
false
) {
arge.set_cancel(
true
);
}
}
Thanks,
Jayesh Goyani