none
Set cursor to specific field in NewForm.aspx RRS feed

  • Question

  • Hello and thank you in advance for your help!

    I currently have a new form where I disabled the first field "Name of Lit Hold" using JavaScript. However, the cursor stays in the first column making it unfriendly to users.

    How can I set the cursor to begin in the second field "Title" by default on the newform.aspx page? Thanks!

    Tuesday, November 22, 2016 10:08 PM

Answers

  • In the same JavaScript which you used to disable the first field, set the cursor in the Title field like

    //Using Jquery
    $("input[Title='Title']").focus();


    ---
    Rajesh
    rjesh.com| @rjesh
    You don't need to buy me a beer, if helpful just smile, vote, and mark it as answer.

    • Marked as answer by AdamDoubleYou Wednesday, November 23, 2016 3:05 PM
    Tuesday, November 22, 2016 11:21 PM
  • Hi,

    We can use the following JavaScript code to achieve it.

    <script src="http://code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () {	
    	$("input[title='Title Required Field']").focus();	
    });
    </script>

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Proposed as answer by romeo donca Wednesday, November 23, 2016 7:03 AM
    • Marked as answer by AdamDoubleYou Wednesday, November 23, 2016 3:05 PM
    Wednesday, November 23, 2016 7:00 AM
    Moderator

All replies

  • In the same JavaScript which you used to disable the first field, set the cursor in the Title field like

    //Using Jquery
    $("input[Title='Title']").focus();


    ---
    Rajesh
    rjesh.com| @rjesh
    You don't need to buy me a beer, if helpful just smile, vote, and mark it as answer.

    • Marked as answer by AdamDoubleYou Wednesday, November 23, 2016 3:05 PM
    Tuesday, November 22, 2016 11:21 PM
  • Hi,

    We can use the following JavaScript code to achieve it.

    <script src="http://code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () {	
    	$("input[title='Title Required Field']").focus();	
    });
    </script>

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Proposed as answer by romeo donca Wednesday, November 23, 2016 7:03 AM
    • Marked as answer by AdamDoubleYou Wednesday, November 23, 2016 3:05 PM
    Wednesday, November 23, 2016 7:00 AM
    Moderator
  • Excellent. Thank you!
    Wednesday, November 23, 2016 3:05 PM
  • Thank you very much!
    Wednesday, November 23, 2016 3:06 PM