Am unable to get the focus of TextBox in a HillyBill templated accordion in my SP online list newform.aspx. i ahve written the code using .focus() of jQuery, but it didnt work!

  function  PreSaveAction()
 //alert('inside presave action');

     //issuetitle is the textbox name 
  issueTitleValue = $("select[Title='Issue Title Required Field']").val();
   if(issueTitleValue=="" || issueTitleValue==null || issueTitleValue == 
         undefined )
     alert('Issue Title is mandatory field from the General Section');
     $("select[Title='Issue Title Required Field']").focus();
          return false; 
         alert('Record Saved Successfully');
    return true;
  am having multi section newform.aspx and the user is confused about in which section, which field is mandatory. how to set the focus in this scenario?

i have used the code mentiioned in this post, create accordion UI for the SP Online newform.aspx to create the accordion UI

Or is there any other approaches like, create a or panel exclusively for showing the error message and display on top of this form? any examples?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.