When a web form loads, By default it auto focus the text box irrespective of the location. Whether that is in top or in bottom of form.
This happens because SharePoint automatically calls a JavaScript function named WebForm_AutoFocus(focusId) to get the auto focus on the textbox. This JavaScript function is present in the Core.js file
To avoid auto focus we can use below code to override Auto focus function:
function WebForm_AutoFocus(focusId)
{
//when the page loads, focus is automatically set to commets textbox, to remove the auto focus override this function.
//Override the AutoFocus function
}
This happens because SharePoint automatically calls a JavaScript function named WebForm_AutoFocus(focusId) to get the auto focus on the textbox. This JavaScript function is present in the Core.js file
To avoid auto focus we can use below code to override Auto focus function:
function WebForm_AutoFocus(focusId)
{
//when the page loads, focus is automatically set to commets textbox, to remove the auto focus override this function.
//Override the AutoFocus function
}
Thank you man, I was struggling with it, I owe you one!
ReplyDelete