Below is my html:
<
telerik:RadTabStrip ID="tsPatientDemographics" runat="server" AutoPostBack="false" OnClientTabSelected="HighlightInitialTabField"
ScrollButtonsPosition="Right" MultiPageID="RadMultiPage1" BackColor="Gray" CausesValidation="False"
Align="Left">
Below is my js:
function HighlightInitialTabField(sender, eventArgs) {
var selectedTab = eventArgs.get_tab();
if (selectedTab != null) {
var selectedTabValue = selectedTab.get_text();
if (selectedTabValue == "Patient") {
var HospAcctno = document.getElementById("HospAcctno");
HospAcctno.focus();
}
else if (selectedTabValue == "Guarantor") {
var GuarRelToPat = document.getElementById("GuarRelToPat");
GuarRelToPat.focus();
}
else if (selectedTabValue == "Pri Ins") {
var priInsCode = document.getElementById("priInsCode");
priInsCode.focus();
}
else if (selectedTabValue == "Sec Ins") {
var secInsCode = document.getElementById("secInsCode");
secInsCode.focus();
}
else if (selectedTabValue == "Ter Ins") {
var terInsCode = document.getElementById("terInsCode");
terInsCode.focus();
}
}
}
When I use the onblur client side event to set focus on a field with another function, it works fine using the same type of syntax above.
During debugging, I am positive that one of the "elses" are hit and it goes into trying to set focus.
Any reason why it doesn't work with the OnClientTabSelected event?
9 Answers, 1 is accepted

if (selectedTabValue == "Patient") {
alert("Selected tab was Patient");
$telerik.$("#HospAcctno").focus();
}


The telerik components use jQuery quite extensively...thats what the $telerik.$ prefix is on the jQuery selector

If so, what do I need to do to reference the jquery functions from the web page?

(once you go jQuery, you never go back)

Do I need to put your code inside a js function, etc? If so, how do I call it?


I'm calling the function HighlightInitialTabField that I have below in my code from the OnClientTabSelected event of the RadTabStrip.
Should I be calling that same function and instead of the code I have, place your jquery code?

var HospAcctno = document.getElementById("HospAcctno");
HospAcctno.focus();
with this
$telerik.$("#HospAcctno").focus();
I mean the other thing to also doublecheck is that the ID is actually "
HospAcctno
", and not an asp.net mangled name like "ctl00_ctl01_HospAcctno
"