Hi Nick,<br><br>Yes this is what I thought originally and try this approach but with no success.<br>I didn't know about the preventDefault method but this, neither seems to be able to stop the default save as window to open.
<br><br>Many thanks for your help<br><br>If anyone got an idea let it come :-)<br><br>function keyDown(e) {<br>&nbsp;&nbsp;&nbsp; if(e.ctrlKey){<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; document.onkeydown = trigger_ctrlS;<br>&nbsp;&nbsp;&nbsp; }<br>}<br>function trigger_ctrlS(e){<br>
&nbsp;&nbsp;&nbsp; var keycode = e.which<br>&nbsp;&nbsp;&nbsp; if(keycode==83){<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; alert(&quot;ctrl s&quot;);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return false<br>&nbsp;&nbsp;&nbsp; }<br>}<br>document.onkeydown = keyDown<br><br>Laurent<br><br><div><span class="gmail_quote">On 3/24/06, 
<b class="gmail_sendername">Nick Fitzsimons</b> &lt;<a href="mailto:nick@nickfitz.co.uk">nick@nickfitz.co.uk</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; Hi<br>&gt;<br>&gt; Does anyone know a good reference or have a nice examples to catch the<br>&gt; keystroke ctrl+s in the browser<br>&gt; I wrote this simple function but everytime the browser try to do a save.<br>&gt;
<br>&lt;snip&gt;<br>&gt;<br>&gt; function keyDown(e) {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; var keycode = e.which<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; if(keycode==17){<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.onkeydown = trigger_ctrlS;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt; }
<br>&gt; function trigger_ctrlS(e){<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; var keycode = e.which<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; if(keycode==83){<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert(&quot;ctrl s: &quot;)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.onkeydown = keyDown<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; }
<br>&gt; }<br>&gt; document.onkeydown = keyDown<br><br><br>The usual way of cancelling the default action for an event is to return<br>false from the event handler; try changing your &quot;return true;&quot; in the<br>above to &quot;return false;&quot; and see if that helps.
<br><br>If that doesn't work, as you say it's for Firefox, try visiting the<br>Firefox/Mozilla developers site:<br>&lt;<a href="http://developer.mozilla.org/en/docs/DOM:event#Introduction">http://developer.mozilla.org/en/docs/DOM:event#Introduction
</a>&gt;<br>explains the &quot;preventDefault&quot; method, which might do what you want.<br><br>HTH,<br><br>Nick.<br>--<br>Nick Fitzsimons<br><a href="http://www.nickfitz.co.uk/">http://www.nickfitz.co.uk/</a><br><br>_______________________________________________
<br>Javascript mailing list<br><a href="mailto:Javascript@LaTech.edu">Javascript@LaTech.edu</a><br><a href="https://lists.LaTech.edu/mailman/listinfo/javascript">https://lists.LaTech.edu/mailman/listinfo/javascript</a><br>
</blockquote></div><br>