bonjour à tous et à toutes
voilà mon soucis, y aurait-il une âme charitable pour m'aider en javascript ?
je fais un formulaire avec un possibilité d'ajout de tags (et de suppresion du tag)
1 - on entre un tag puis on clique sur "ajouter un tag". Ce dernier créer un tag dans une liste (avec la possibilité de le supprimer).
2 - je supprime le tag de la liste en cliquant sur le "X".
Voici ou j'en suis...
fichier html
Fichier js
Si quelqu'un pouvait me dépanner...
voilà mon soucis, y aurait-il une âme charitable pour m'aider en javascript ?
je fais un formulaire avec un possibilité d'ajout de tags (et de suppresion du tag)
1 - on entre un tag puis on clique sur "ajouter un tag". Ce dernier créer un tag dans une liste (avec la possibilité de le supprimer).
2 - je supprime le tag de la liste en cliquant sur le "X".
Voici ou j'en suis...
fichier html
Bloc de code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Mes tags</title>
<script type="text/javascript" src="js/gestiontags.js"></script>
<style type="text/css">
fieldset {
border:none;
border-bottom:1px dashed #333;
margin-bottom:20px;
}
a {cursor:pointer;}
#ContentTagOeil input, #ContentTagNez input, #ContentTagBouche input {
width:150px;
}
</style>
</head>
<body>
ceci est un essai de gestion de tag
<form action="#" name="FormTag" id="FormTag" method="post">
<fieldset>
<legend>Œil</legend>
<input type="text" id="ContentTagOeil" /> <a href="#" title="Ajouter ce tag" onclick="AjouterTag();return false;">Ajouter ce tag</a>
<p>Ambre (<a href="#" title="Supprimer ce tag" onclick="SupprimerTag();return false;">X</a>), claire (<a href="#" title="Supprimer ce tag" onclick="SupprimerTag();return false;">X</a>)</p>
</fieldset>
<fieldset>
<legend>Nez</legend>
<input type="text" id="ContentTagNez" /> <a href="#" title="Ajouter ce tag" onclick="AjouterTag();return false;">Ajouter ce tag</a>
<p>puissant (<a href="#" title="Supprimer ce tag" onclick="SupprimerTag();return false;">X</a>), légé (<a href="#" title="Supprimer ce tag" onclick="SupprimerTag();return false;">X</a>)</p>
</fieldset>
<fieldset>
<legend>Bouche</legend>
<input type="text" id="ContentTagBouche" /> <a href="#" title="Ajouter ce tag" onclick="AjouterTag();return false;">Ajouter ce tag</a>
<p>Tannique (<a href="#" title="Supprimer ce tag" onclick="SupprimerTag();return false;">X</a>), chêne (<a href="#" title="Supprimer ce tag" onclick="SupprimerTag();return false;">X</a>)</p>
</fieldset>
</form>
</body>
</html>
Fichier js
Bloc de code:
function AjouterTag(){
if (document.getElementById('ContentTagOeil').value.length<=3) {
alert("Vous devriez remplir ce champs avec un terme de plus de trois lettres");
}
document.getElementById('ContentTagOeil').focus();
return false;
} else {
}
function SupprimerTag(){
}
Si quelqu'un pouvait me dépanner...