Envoie d'un formulaire
Résolu
gain
-
gain -
gain -
Bonjour,
j'ai un formulaire sur lequel une image est affichée. Cependant lorsque l'on clique sur cette image celà agit comme le bouton envoyer et envoie le formulaire. Pour empêcher celà est-ce que je dois ajouter une fonction qui empêche l'envoie du formulaire si un champ est vide(j'aime moins cette idée par rapport aux visiteur qui s'attende à voir un agrandissement) ou est-ce qu'il existe une fonction ou quelque chose que je pourrais ajouter à la photo pour empecher le lien de se faire. Je suis dsl si c'est stupide mais je ne sais pas.
Merci,
<form style="margin-left: 455px; margin-top: 250px;" form method="POST" action="formmail.php">
<font color="white"><big><b>C</b>ommande</big></font><big></big>
<table style="font-family: Tw Cen MT; font-size: 1.2em; color: black;" border="0"><br>
<tbody>
<tr>
<td><span style="font-weight: bold;">P</span>roduit</td>
<td> <input style="border-style: inset; border-width: 3px; width: 75px; height:100px;" name="name" type="image"src="images/img_024.jpg"></td>
<td><span style="font-weight: bold;"></td>
<td> <input style="border-style: inset; border-width: 3px; width: 51px; visibility: hidden;" name="BA_024" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">N</span>om</td>
<td> <input style="border-style: inset; border-width: 3px; width: 190px;" name="nom" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">P</span>rénom</td>
<td> <input style="border-style: inset; border-width: 3px; width: 190px;" name="prenom" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">A</span>dresse</td>
<td> <input style="border-style: inset; border-width: 3px; width: 190px;" name="Adresse" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">V</span>ille</td>
<td> <input style="border-style: inset; border-width: 3px; width: 190px;" name="Ville" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">P</span>rovince</td>
<td> <input style="border-style: inset; border-width: 3px; width: 190px;" name="Province" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">C</span>ode <span style="font-weight: bold;">P</span>ostal</td>
<td> <input style="border-style: inset; border-width: 3px; width: 190px;" name="Code Postal" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">C</span>ourriel</td>
<td> <input style="border-style: inset; border-width: 3px; width: 190px;" name="Courriel" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">C</span>ommentaires</td>
<td> <textarea style="border-style: inset; border-width: 3px; width: 190px;height:109px;" rows="6" name="commentaires"> </textarea> </td>
</tr>
<tr>
<td style="text-align: center;" colspan="2"> <input style="border: 2px outset white; font-family: Tw Cen MT; font-size: 1.2em; background-color: rgb(55, 55, 55); color: white; font-weight: bold; width: 220px; text-align: center;" value="Envoyer" type="submit"> </td>
</tr>
</tbody>
</table>
</form>
j'ai un formulaire sur lequel une image est affichée. Cependant lorsque l'on clique sur cette image celà agit comme le bouton envoyer et envoie le formulaire. Pour empêcher celà est-ce que je dois ajouter une fonction qui empêche l'envoie du formulaire si un champ est vide(j'aime moins cette idée par rapport aux visiteur qui s'attende à voir un agrandissement) ou est-ce qu'il existe une fonction ou quelque chose que je pourrais ajouter à la photo pour empecher le lien de se faire. Je suis dsl si c'est stupide mais je ne sais pas.
Merci,
<form style="margin-left: 455px; margin-top: 250px;" form method="POST" action="formmail.php">
<font color="white"><big><b>C</b>ommande</big></font><big></big>
<table style="font-family: Tw Cen MT; font-size: 1.2em; color: black;" border="0"><br>
<tbody>
<tr>
<td><span style="font-weight: bold;">P</span>roduit</td>
<td> <input style="border-style: inset; border-width: 3px; width: 75px; height:100px;" name="name" type="image"src="images/img_024.jpg"></td>
<td><span style="font-weight: bold;"></td>
<td> <input style="border-style: inset; border-width: 3px; width: 51px; visibility: hidden;" name="BA_024" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">N</span>om</td>
<td> <input style="border-style: inset; border-width: 3px; width: 190px;" name="nom" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">P</span>rénom</td>
<td> <input style="border-style: inset; border-width: 3px; width: 190px;" name="prenom" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">A</span>dresse</td>
<td> <input style="border-style: inset; border-width: 3px; width: 190px;" name="Adresse" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">V</span>ille</td>
<td> <input style="border-style: inset; border-width: 3px; width: 190px;" name="Ville" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">P</span>rovince</td>
<td> <input style="border-style: inset; border-width: 3px; width: 190px;" name="Province" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">C</span>ode <span style="font-weight: bold;">P</span>ostal</td>
<td> <input style="border-style: inset; border-width: 3px; width: 190px;" name="Code Postal" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">C</span>ourriel</td>
<td> <input style="border-style: inset; border-width: 3px; width: 190px;" name="Courriel" type="text"> </td>
</tr>
<tr>
<td><span style="font-weight: bold;">C</span>ommentaires</td>
<td> <textarea style="border-style: inset; border-width: 3px; width: 190px;height:109px;" rows="6" name="commentaires"> </textarea> </td>
</tr>
<tr>
<td style="text-align: center;" colspan="2"> <input style="border: 2px outset white; font-family: Tw Cen MT; font-size: 1.2em; background-color: rgb(55, 55, 55); color: white; font-weight: bold; width: 220px; text-align: center;" value="Envoyer" type="submit"> </td>
</tr>
</tbody>
</table>
</form>
A voir également:
- Envoie d'un formulaire
- Whatsapp formulaire opposition - Guide
- Formulaire de réclamation facebook compte désactivé - Guide
- Formulaire de reclamation instagram - Guide
- Envoie impossible messenger - Forum Facebook Messenger
- Confirmer le nouvel envoi du formulaire err_cache_miss ✓ - Forum PHP
2 réponses
je suis pas sur d'avoir bien compris en faite tu veux utiliser une image au lieu d'un bouton envoyer ? une foi envoyer dans ton form tu dois avoir action="...." redirige vers cette page et test toute tes variable avec isset et SI toutes tes variable sont defini alors tu fais ton traitement sinon tu remet ton formulaire et tu pourrai meme le préreremplir avec des conditionnel IF(ISSET(...){echo" value=' ....';}
Salut.
Tu parles pour cette image ?
Les <input type="image" ... /> au automatiquement la même fonction qu'un input type="submit".
Si tu veux simplement afficher l'image, pourquoi ne pas utiliser <img /> ?
Tu parles pour cette image ?
<input style="border-style: inset; border-width: 3px; width: 75px; height:100px;" name="name" type="image"src="images/img_024.jpg">
Les <input type="image" ... /> au automatiquement la même fonction qu'un input type="submit".
Si tu veux simplement afficher l'image, pourquoi ne pas utiliser <img /> ?