Je cherche un javascript qui rend le texte à l'intérieur de la zone de texte à disparaître une fois que la souris se trouve dans la zone de texte et réapparaît sur défaut .. il doit être un javascript ...recherche d'un script pour textbox filigrane
Répondre
Peut-être quelque chose comme ça ...
<script type=text/javascript>
function clearGhost(id,text) {
var obj = document.getElementById(id);
if (obj && obj.value == text) obj.value = '';
}
function Ghost(id,text) {
var obj = document.getElementById(id);
if (obj && obj.value == '') obj.value = text;
}
</script>
<input type=text name=myText id=myText size=20 value="Ghost Text"
onfocus="clearGhost('myText','Ghost Text');" onblur="Ghost('myText','Ghost Text');">
ce n'est pas testé ... serait certainement plus facile avec jQuery.
..... ne fonctionne pas mon pote ... – Sachindra
Fonctionne parfaitement pour moi ici à: http://fosco.com/test1.php – Fosco
vous voulez qu'il s'en aille quand ils cliquent droite? pas juste la souris dessus ... si vous vouliez qu'il disparaisse en survol, ajoutez simplement onmouseover = "clearGhost ('myText', 'Ghost Text');" et onmouseout = "Ghost ('myText', 'Ghost Text');" pour le faire revenir. – Fosco
Les navigateurs récents font sans JavaScript avec l'placeholder
attribut: http://dev.w3.org/html5/spec-author-view/common-input-element-attributes.html#the-placeholder-attribute
+1 pour m'avoir appris l'attribut 'placholder' –
<input type="text" value="mm/dd/yyyy" id="date1"/>
<script type="text/javascript">
(function(){
function showHideDefaultText(elem){
var defaultValue = elem.defaultValue;
var showDefaultText = function(){
if(this.value.length === 0){
this.value = defaultValue;
}
}
var hideDefaultText = function(){
if(this.value===defaultValue){
this.value = "";
}
}
elem.onfocus = hideDefaultText;
elem.onblur = showDefaultText;
}
var d1 = document.getElementById("date1");
showHideDefaultText(d1);
})()
</script>
- 1. WPF filigrane PasswordBox de filigrane TextBox
- 2. TextBox Recherche manipulation de chaînes
- 3. TextBox multiligne en html pour le script php
- 4. Datepicker Filigrane
- 5. Filigrane PHP
- 6. Filigrane et vignette - Codeigniter
- 7. Script shell, fichier de recherche pour chaîne
- 8. Filigrane dans System.Windows.Forms.TextBox
- 9. Filigrane/arrière-plan FAX?
- 10. Filigrane d'image en php
- 11. PyQt4 - Filigrane d'image
- 12. recherche de fichier script bash
- 13. Simple Youtube Recherche Script PHP
- 14. Filigrane sonore, lecture via l'iPhone
- 15. Ajout d'un filigrane de texte
- 16. phpThumb - changer la taille du filigrane
- 17. ImageMagick Mogrify: lot avec filigrane
- 18. Recherche d'un script PHP pour filtrer un flux RSS
- 19. Filigrane sur les images hotlinkées?
- 20. CodeIgniter Image Manipulation (Redimensionner & Filigrane)
- 21. RegEx pour Multiline ASP.NET Textbox
- 22. Caret personnalisé pour WinForms TextBox
- 23. textbox
- 24. Comment faire Textbox Envoyer
- 25. rapport de cristal: définir l'image pour fond de rapport (filigrane)
- 26. Recherche d'erreur JS - "Arrêtez d'exécuter ce script?"
- 27. asp.net textbox ajoutant BehaviorID
- 28. C#, textbox, .NET
- 29. Dessin sur un TextBox dans .NET Compact Framework
- 30. Recherche Google en utilisant le script python
Utilisez-vous tout cadre, JQuery, Prototype, etc? –
le travail n'est rien en tant que tel ... c'est un simple travail php et je suis à la recherche d'un javascript facile .. – Sachindra
Le titre pue, devrait être modifié afin qu'il soit utile aux personnes effectuant des recherches dans le futur. – epascarello