This is a migrated thread and some comments may be shown as answers.

Can't get focus after the radalert

1 Answer 83 Views
Window
This is a migrated thread and some comments may be shown as answers.
sks sks
Top achievements
Rank 1
sks sks asked on 08 May 2010, 08:31 AM

function

 

 

ValidateTreatment() {

 

 

 

var radcboLocType = document.getElementById("<%=radcboLocType.ClientID%>");

 

 

 

var radtxtName1 = document.getElementById("<%=radtxtName.ClientID%>");

 

 

 

var radtxtTreatmentLocAddr1 = document.getElementById("<%=radtxtTreatmentLocAddr1.ClientID%>");

 

 

 

var radcboTreatmentLocState = document.getElementById("<%=radcboTreatmentLocState.ClientID%>");

 

 

 

var radtxtTreatmentLocCity = document.getElementById("<%=radtxtTreatmentLocCity.ClientID%>");

 

 

 

var radmsktxtTreatmentLocZipCode = document.getElementById("<%=radmsktxtTreatmentLocZipCode.ClientID%>");

 

 

 

var radmsktxtTreatmentLocPhoneNum = document.getElementById("<%=radmsktxtTreatmentLocPhoneNum.ClientID%>");

 

 

 

var TreatmentEmailAddrs = $find("<%= raktxtTreatmentLocEmailAddress.ClientID %>");

 

 

 

var regEmailValidation = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/

 

 

 

 

if (radcboLocType.value.trim() == "") {

 

 

 

var oAlert = radalert("Location Type cannot be blank.");

 

oAlert.add_close(

 

function () { radcboLocType.focus() });

 

 

 

return false;

 

}

 

 

if (radtxtName1.value.trim() == "") {

 

 

 

var oAlert1 = radalert("Location Name cannot be blank.");

 

oAlert1.add_close(

 

function () { radtxtName1.focus() });

 

 

 

return false;

 

}

 

 

if (radtxtTreatmentLocAddr1.value.trim() == "") {

 

 

 

var oAlert2 = radalert("Mailing Address cannot be blank.");

 

oAlert2.add_close(

 

function () { radtxtTreatmentLocAddr1.focus() });

 

 

 

return false;

 

}

 

 

if (radtxtTreatmentLocCity.value.trim() == "") {

 

 

 

var oAlert3 = radalert("Mailing City cannot be blank.");

 

oAlert3.add_close(

 

function () { radtxtTreatmentLocCity.focus() });

 

 

 

return false;

 

}

 

 

 

if (radcboTreatmentLocState.value.trim() == "") {

 

 

 

var oAlert4 = radalert("Mailing State cannot be blank.");

 

oAlert4.add_close(

 

function () { radcboTreatmentLocState.focus() });

 

 

 

return false;

 

}

 

 

if (radmsktxtTreatmentLocZipCode.value.trim() == "") {

 

 

 

var oAlert5 = radalert("Mailing Zip Code cannot be blank.");

 

oAlert5.add_close(

 

function () { radmsktxtTreatmentLocZipCode.focus() });

 

 

 

return false;

 

}

 

 

if (radmsktxtTreatmentLocPhoneNum.value.trim() == "") {

 

 

 

var oAlert6 = radalert("Phone Number cannot be blank.");

 

oAlert6.add_close(

 

function () { radmsktxtTreatmentLocPhoneNum.focus() });

 

 

 

return false;

 

}
}

I used this fucntion on client of the save button.. but after the radalert i can't get the focus to the control. Please Help me asap.. Thank you in advance..

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 11 May 2010, 12:07 PM
Hello,

Try calling focus() with a small timeout. If this doesn't help, please open a support ticket and send us a sample project where we could get a better view over your exact setup and logic.


Kind regards,
Georgi Tunev
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.
Tags
Window
Asked by
sks sks
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or