Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is my workaround:</p> <p>Store the last focused form field along with the scrollbar positions every time a form field gets focus, like:</p> <pre><code>&lt;input id="Text1" type="text" onfocus="SetPageActiveElement(this);" /&gt; &lt;select id="Select1" onfocus="SetPageActiveElement(this);"&gt; &lt;option&gt;option 1&lt;/option&gt; &lt;/select&gt; </code></pre> <p>Use on blur event (onchange for selects) to call Page_ClientValidate() and force validation summary to refresh its contents. Also clear the last focused element on blur just in case. So you end up having something like:</p> <pre><code>&lt;input id="Text1" type="text" onfocus="SetPageActiveElement(this);" onblur="ClearValidationSummary();" /&gt; &lt;select id="Select1" onfocus="SetPageActiveElement(this);" onchange="ClearValidationSummary();"&gt; &lt;option&gt;option 1&lt;/option&gt; &lt;/select&gt; </code></pre> <p>These are my js functions:</p> <pre><code>var activeElement; // This function saves the last element which got focus and saves it on a variable to use it later // Same thing applies for vertical and horizontal scroll position function SetPageActiveElement(element) { activeElement = element; } function ClearValidationSummary() { var vscroll = (document.all ? document.scrollTop : window.pageYOffset); var hscroll = (document.all ? document.scrollLeft : window.pageXOffset); // Forces page validation to refresh validation summaries Page_ClientValidate(); if (activeElement != null) { // Returns the last vertical and horizontal scroll bar position window.scrollTo(hscroll, vscroll); SetPageActiveElement(null); } } </code></pre> <p>Hope it helps somebody.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload