Can't get focus after the radalert

2 posts, 0 answers
  1. sks sks
    sks sks avatar
    3 posts
    Member since:
    Apr 2010

    Posted 08 May 2010 Link to this post

    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..

  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 11 May 2010 Link to this post

    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.
Back to Top