Hi Guys,
A really simple question I guess, I would like to disable the Enter key on my website. I explain myself, I have a Global Directory Intranet that use AJAX. So when a user starts typing the desired name the search is already done on the LDAP server. But if the user, out of habit, press the enter key at the end of her search it, for reason unknow, reload the page, thus loosing here search.
I’m posting my code in case the problem reside in there.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
<title>Repertoire | Direction des Technologies de l'Information</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css" media="all">@import "../intranet/misc/drupal.css";</style>
<link href="css/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="scripts/pngfix.js"></script>
<script type="text/javascript" src="script/bottin.js"></script>
</head>
<body onload="setFocus()">
<div id="head">
<div id="logo"></div>
</div>
<div id="content" style="margin-left: 0px; margin-right: 0px">
<!-- begin content -->
<div class="tborder" style="margin-bottom: 2px;">
<div class="catbg" style="padding: 3px 6px 3px 6px; font-size: 15px; text-align: center;">
<img src="../intranet/themes/newsportal/images/globe.png" height="32" width="32" border="0" alt="Répertoire Globale"/> Répertoire téléphonique de la Ville de Terrebonne
</div>
<div class="row2">
<div class="errorwrap" style="margin: 0px;padding-bottom: 0px;">
<h4>Attention!</h4>
<p>Voici les étapes à suivre pour effectuer une recherche.</p>
<ul>
<li>Choisir une catégorie parmi les suivantes: Nom de famille, Prénom, Numéro de poste</li>
<li>Inscrire dans le champs, à droite, le critère à rechercher</li>
<li>La recherche débutera automatiquement</li>
<li>IMPORTANT: Vous ne devez pas appuyer sur la touche ENTRÉE pour démarrer la recherche</li>
<li>Pour faire une recherche globale du répertoire vous devez mettre un * comme critère de recherche.</li>
</ul>
</div>
</div>
<div id="myMessage"></div>
<form id=formUserList name="formUserList">
</p>
<table width="100%" border=0 cellSpacing=0 cellPadding=1>
<tr>
<td nowrap width="10%">
<b>Effectuez une recherche par </b>
</td>
<td nowrap width="15%">
<select class="input" name="findBy" id=findBy onchange="removeText()">
<option value="last">Nom de Famille<br /></option>
<option value="first">Prénom<br /></option>
<option value="dn">Numéro de poste<br /></option>
<option value="department">Direction<br /></option>
</select>
</td>
<td width="75%">
<input type="text" maxLength=40 size="40" name="pattern" id="pattern" value="" onkeyup="showUsers(findBy.value, this.value)">
</td>
</tr>
</table>
</form>
<div id="result_list"></div>
</div>
<!-- end content -->
</div>
<div class="tborder" id="footer">
Copyright 2007-2008 Direction des Technologies de l'information de la ville de Terrebonne. All rights reserved
</div>
</body>
</html>
My code isn’t perfect, cause I’m only starting inthe HTML buisness, I’m still cleaning it up.
Thank you for your help.
Cheers