<p>My current project is to write a web application that is an equivalent of an existing desktop application.  </p>

<p>In the desktop app at certain points in the workflow the user might click on a button and then be shown a form to fill in.  Even if it takes a little time for the app to display the form, expert users know what the form will be and will start typing, knowing that the app will "catch up with them".</p>

<p>In a web application this doesn't happen: when the user clicks a link their keystrokes are then lost until the form on the following page is dispayed.  Does anyone have any tricks for preventing this?  Do I have to move away from using separate pages and use AJAX to embed the form in the page using something like <a href="http://code.google.com/webtoolkit/" rel="nofollow noreferrer">GWT</a>, or will that still have the problem of lost keystrokes?</p>

[{'answer_id': 61696, 'author': 'Joel Coehoorn', 'author_id': 3043, 'author_profile': 'https://Stackoverflow.com/users/3043', 'pm_score': 0, 'selected': False, 'text': '<p>AJAX or plugin are your only chances.</p>\n'}, {'answer_id': 61702, 'author': 'andyuk', 'author_id': 2108, 'author_profile': 'https://Stackoverflow.com/users/2108', 'pm_score': 3, 'selected': False, 'text': '<p>Keystrokes won\'t have an effect until the page has loaded, javascript has been processed and the text field is then focused.</p>\n\n<p>Basically what you are really asking is; <strong>how do I speed up a web application to increase response times?</strong> Your anwser is AJAX! </p>\n\n<p>Carefully think about the most common actions in the application and use AJAX to minimise the reloading of webpages. Remember, don\'t over-use AJAX. Using too much javascript can hinder usability just as much as it can improve it.</p>\n\n<p>Related reading material:  </p>\n\n<ul>\n<li><a href="http://www.useit.com/papers/responsetime.html" rel="nofollow noreferrer">Response Times: The Three Important Limits</a> - Great article from the usability king, Jacon Neilson.  </li>\n<li><a href="http://ajaxian.com/archives/ajax-usability-mistakes" rel="nofollow noreferrer">Ajax Usability Mistakes</a>  </li>\n<li><a href="http://experiencedynamics.blogs.com/site_search_usability/2007/12/ajax-usability.html" rel="nofollow noreferrer">AJAX Usability Checklist</a></li>\n</ul>\n'}, {'answer_id': 61708, 'author': 'Leo Moore', 'author_id': 6336, 'author_profile': 'https://Stackoverflow.com/users/6336', 'pm_score': 0, 'selected': False, 'text': '<p>I think it will be quite hard to do what you want. I presume that the real problem is that the new page takes too long to load. You should look at caching the page or doing partial caching on the static components such as pictures etc. to improve the load time or preloading the page and making it invisible. (see <a href="https://web.archive.org/web/20080925024942/http://www.sitepoint.com/print/1273/?PHPSESSID=850e8f554020735a2e213dd825cb9e3d" rel="nofollow noreferrer">Simple Tricks for More Usable Forms</a> for some ideas)</p>\n\n<p>For coding options you could use javascript to capture the keystrokes (see <a href="https://web.archive.org/web/20090130113945/http://lists.evolt.org:80/archive/Week-of-Mon-20021230/131136.html" rel="nofollow noreferrer">Detecting various Keystroke</a>)</p>\n\n<pre><code>&lt;html&gt;&lt;head&gt;\n&lt;script language=javascript&gt;\nIE=document.all;\nNN=document.layers;\nkys="";\nif (NN){document.captureEvents(Event.KEYPRESS)}\ndocument.onkeypress=katch\nfunction katch(e){\nif (NN){kys+=e.which}\nif (IE){kys+=event.keyCode}\ndocument.forms[0].elements[0].value=kys\n}\n&lt;/script&gt;\n&lt;/head&gt;\n&lt;body&gt;\n&lt;form&gt;&lt;input&gt;&lt;/form&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n\n<p>You will need to save and then transfer them to the new page after control passes from the current page. (see <a href="http://www.codeproject.com/KB/aspnet/Save_on_Close_of_Browser.aspx" rel="nofollow noreferrer">Save Changes on Close of Browser or when exiting the page</a>)</p>\n\n<p>For some general info on problems with detecting keystrokes in the various browsers have a look at <a href="http://www.quirksmode.org/js/keys.html" rel="nofollow noreferrer">Javascript - Detecting keystrokes</a>.</p>\n'}, {'answer_id': 72376, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': "<p>Perhaps I am under-thinking the problem but I'll throw this out there... You could just put your form inside a hidden div or similar container that you show (perhaps give it a modal look/behavior?) on the click event of the link. That way the form is already loaded as part of the page. It should appear almost instantly.</p>\n\n<p>You can find modal div tutorials all over the place, shouldn't be too tricky. If you're using ASP.NET there's even one included in Microsoft's AJAX library.</p>\n"}]
['https://Stackoverflow.com/questions/61688', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2649/']