Fonction javascript
sspacy
Messages postés
61
Statut
Membre
-
sspacy Messages postés 61 Statut Membre -
sspacy Messages postés 61 Statut Membre -
Quelle est la fonction de javascript qui "élimine" les espaces au début d'une chaine de caractères ?
J'en ai besoin pour un test dans un formulaire.
Merciiiiii
:*)
.::Sspacy.Millevazion: that's my world::.
J'en ai besoin pour un test dans un formulaire.
Merciiiiii
:*)
.::Sspacy.Millevazion: that's my world::.
A voir également:
- Fonction javascript
- Fonction si et - Guide
- Fonction miroir - Guide
- Fonction moyenne excel - Guide
- Fonction remplacer sur word - Guide
- Fonction somme excel - Guide
1 réponse
Voici le code :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script>
<!-- Author: HackTrack -->
function trimText(){
var textToTrim = document.aForm.entree.value;
var textLength = textToTrim.length;
var i=0;
while(i<textToTrim.length){
var aChar = textToTrim.substring(i,i+1);
if(aChar!=" "){
break;
}
i++;
}
document.aForm.entree.value = textToTrim.substring(i,textToTrim.length);
document.aForm.submit;
}
</script>
</head>
<body onLoad="document.aForm.entree.value.trim;">
<form name="aForm" action="otherPage.html;">
<input name="entree" type="texte" value=" abcdefgh" />
<br>
<button onClick="trimText();">Valider</button>
</form>
</body>
</html>
;-)
HackTrack
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script>
<!-- Author: HackTrack -->
function trimText(){
var textToTrim = document.aForm.entree.value;
var textLength = textToTrim.length;
var i=0;
while(i<textToTrim.length){
var aChar = textToTrim.substring(i,i+1);
if(aChar!=" "){
break;
}
i++;
}
document.aForm.entree.value = textToTrim.substring(i,textToTrim.length);
document.aForm.submit;
}
</script>
</head>
<body onLoad="document.aForm.entree.value.trim;">
<form name="aForm" action="otherPage.html;">
<input name="entree" type="texte" value=" abcdefgh" />
<br>
<button onClick="trimText();">Valider</button>
</form>
</body>
</html>
;-)
HackTrack
Merciiiiii :*)
.::Sspacy.Millevazion: that's my world::.