Pb de lancement onclick="fonction();">
Résolu
cgershon
Messages postés
267
Date d'inscription
Statut
Membre
Dernière intervention
-
cgershon Messages postés 267 Date d'inscription Statut Membre Dernière intervention -
cgershon Messages postés 267 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Je n'arrive pas a lancer la fonction nouvelle() lors du click sur le input 'nouveau' parmis les 3 input qui sont dans la form pourquoi ?
<script type="text/javascript" language="javascript" >
function clr(champ){
document.getElementById(champ).value= "";
}
function nouvelle(){
clr("style");
clr("origine");
clr("Particularites");
clr("groupes");
clr("site");
}
</script>
<span style="position:absolute;left:350px;top:15px; " >
<h1>Introduire un nouvel artiste</h1></span>
<span style="position:absolute;left:800px;top:25px; " > base: hadad table:artistes
<?php echo '<font color="">'.' '.date("d").' '.date("m").' '.date("Y");?>
</span>
<fieldset>
<span style="position:absolute;left:270px;top:55px; " >
<form method="post" name = "inscription" onsubmit=" signin(this.nomd.value,this.prenomd.value,this.style.value,this.origine.value,this.groupes.value,this.particularites.value,this.site.value,this.code.value,'artistes');return false;" >
<div id="msg">
</div>
<table width="800" border="2" cellspacing="3" align="left">
<tr>
<td >
<div style="position:relative;left:10px;top:0px; ">
<label class="alignleft" for="nomd"> <strong>Nom de l'artiste:</strong>
</label>
<input name="nomd" id="nomd" size="30" maxlength="30" >
</div></td>
</tr>
<tr>
<td >
<div style="position:relative;left:10px;top:0px; " >
<label class="alignleft" for="prenomd"> <strong>Prenom:</strong>
</label>
<input name="prenomd" id="prenomd" size="30" maxlength="30" >
</div></td>
</tr>
<tr>
<td >
<div style="position:relative;left:10px;top:0px; " >
<label class="alignLeft" for="style"> <strong>Style:</strong>
</label>
<input name="style" id="style" size="30" maxlength="30">
</div></td>
</tr>
<tr>
<td >
<div style="position:relative;left:10px;top:0px; ">
<label class="alignLeft" for="origine"> <strong>Origine:</strong>
</label>
<input name="origine" id="origine" size="30" maxlength="30" >
</div></td>
</tr>
<tr>
<td >
<div style="position:relative;left:10px;top:0px; ">
<label class="alignLeft" for="particularites"> <strong> Particularités:</strong>
</label>
<textarea name="particularites" rows="8" cols="70">
Votre message ici.
</textarea>
</div></td>
</tr>
<tr>
<td >
<div style="position:relative;left:10px;top:0px; ">
<label class="alignLeft" for="groupes"> <strong>groupes:</strong>
</label>
<textarea name="groupes" id="groupes" rows="8" cols="70">
Votre message ici.
</textarea>
</div></td>
</tr>
<tr>
<td >
<div style="position:relative;left:10px;top:0px; " >
<label class="alignLeft" for="site"> <strong>Site Web:</strong>
</label>
<input name="site" id="site" size="50" maxlength="50" >
</div></td>
</tr>
<tr>
<td >
<div style="position:relative;left:10px;top:0px; " >
<label class="alignLeft" for="code"> <strong>Code(o=lettre 0=chiffre):</strong>
</label>
<img src="image_code.php" alt="" >
<input name="code" id="code" size="5" maxlength="4">
</div></td>
</tr>
<tr>
<td colspan="2">
<div class="alignRight">
<input name="envoyer" type="submit" value="Envoyer" >
</div></td>
<td colspan="2">
<div class="alignRight">
<input name="nouvelle" type="submit" value="Nouveau" onclick="nouvelle();">
</div></td>
<td colspan="2">
<div class="alignRight">
<input name="annuler" type="submit" value="Annuler" onclick="javascript:history.back();">
</div></td>
</tr>
</table>
</form>
</fieldset>
Je n'arrive pas a lancer la fonction nouvelle() lors du click sur le input 'nouveau' parmis les 3 input qui sont dans la form pourquoi ?
<script type="text/javascript" language="javascript" >
function clr(champ){
document.getElementById(champ).value= "";
}
function nouvelle(){
clr("style");
clr("origine");
clr("Particularites");
clr("groupes");
clr("site");
}
</script>
<span style="position:absolute;left:350px;top:15px; " >
<h1>Introduire un nouvel artiste</h1></span>
<span style="position:absolute;left:800px;top:25px; " > base: hadad table:artistes
<?php echo '<font color="">'.' '.date("d").' '.date("m").' '.date("Y");?>
</span>
<fieldset>
<span style="position:absolute;left:270px;top:55px; " >
<form method="post" name = "inscription" onsubmit=" signin(this.nomd.value,this.prenomd.value,this.style.value,this.origine.value,this.groupes.value,this.particularites.value,this.site.value,this.code.value,'artistes');return false;" >
<div id="msg">
</div>
<table width="800" border="2" cellspacing="3" align="left">
<tr>
<td >
<div style="position:relative;left:10px;top:0px; ">
<label class="alignleft" for="nomd"> <strong>Nom de l'artiste:</strong>
</label>
<input name="nomd" id="nomd" size="30" maxlength="30" >
</div></td>
</tr>
<tr>
<td >
<div style="position:relative;left:10px;top:0px; " >
<label class="alignleft" for="prenomd"> <strong>Prenom:</strong>
</label>
<input name="prenomd" id="prenomd" size="30" maxlength="30" >
</div></td>
</tr>
<tr>
<td >
<div style="position:relative;left:10px;top:0px; " >
<label class="alignLeft" for="style"> <strong>Style:</strong>
</label>
<input name="style" id="style" size="30" maxlength="30">
</div></td>
</tr>
<tr>
<td >
<div style="position:relative;left:10px;top:0px; ">
<label class="alignLeft" for="origine"> <strong>Origine:</strong>
</label>
<input name="origine" id="origine" size="30" maxlength="30" >
</div></td>
</tr>
<tr>
<td >
<div style="position:relative;left:10px;top:0px; ">
<label class="alignLeft" for="particularites"> <strong> Particularités:</strong>
</label>
<textarea name="particularites" rows="8" cols="70">
Votre message ici.
</textarea>
</div></td>
</tr>
<tr>
<td >
<div style="position:relative;left:10px;top:0px; ">
<label class="alignLeft" for="groupes"> <strong>groupes:</strong>
</label>
<textarea name="groupes" id="groupes" rows="8" cols="70">
Votre message ici.
</textarea>
</div></td>
</tr>
<tr>
<td >
<div style="position:relative;left:10px;top:0px; " >
<label class="alignLeft" for="site"> <strong>Site Web:</strong>
</label>
<input name="site" id="site" size="50" maxlength="50" >
</div></td>
</tr>
<tr>
<td >
<div style="position:relative;left:10px;top:0px; " >
<label class="alignLeft" for="code"> <strong>Code(o=lettre 0=chiffre):</strong>
</label>
<img src="image_code.php" alt="" >
<input name="code" id="code" size="5" maxlength="4">
</div></td>
</tr>
<tr>
<td colspan="2">
<div class="alignRight">
<input name="envoyer" type="submit" value="Envoyer" >
</div></td>
<td colspan="2">
<div class="alignRight">
<input name="nouvelle" type="submit" value="Nouveau" onclick="nouvelle();">
</div></td>
<td colspan="2">
<div class="alignRight">
<input name="annuler" type="submit" value="Annuler" onclick="javascript:history.back();">
</div></td>
</tr>
</table>
</form>
</fieldset>
A voir également:
- Pb de lancement onclick="fonction();">
- Fonction si et - Guide
- Realme gt 7t - Guide
- Qu'est ce qui se lance au démarrage de l'ordinateur - Guide
- Fonction miroir - Guide
- Fonction moyenne excel - Guide
2 réponses
Remplace:
par
<input name="nouvelle" type="submit" value="Nouveau" onclick="nouvelle();">
par
<button type="button" name="nouvelle" value="Nouveau" onclick="nouvelle();"></button>