[Problème] Formulaire qui génère un code BBcode

3 participants

Voir le sujet précédent Voir le sujet suivant Aller en bas

Résolu [Problème] Formulaire qui génère un code BBcode

Message par Leziel Dim 29 Juil 2012 - 13:13

Bonsoir (:

J'ai actuellement créé un formulaire qui, une fois envoyé, génère un code BBcode dans un cadre. Seulement, mon code ne marche pas. Quand je clique sur "Envoyer le formulaire", celui-ci ne s'envoie pas. J'ai essayer de trouver la réponse, j'ai même regardé des topics sur le forum mais rien ne correspond à mon problème pour tant, mon code me semble correct. Voici mon code :

Code:
<html>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>Generateur de presentation</title>

<script type="text/javascript">
        //<!--
                function change_onglet(name)
                {
                        document.getElementById('onglet_'+anc_onglet).className = 'onglet_0 onglet';
                        document.getElementById('onglet_'+name).className = 'onglet_1 onglet';
                        document.getElementById('contenu_onglet_'+anc_onglet).style.display = 'none';
                        document.getElementById('contenu_onglet_'+name).style.display = 'block';
                        anc_onglet = name;
                }
        //-->
        </script>

    <style type="text/css">
.onglets {
text-align:center;
}
        .onglet
        {
                display:inline-block;
                margin-left:3px;
                margin-right:3px;
                padding:3px;
                cursor:pointer;
        }
.onglet_0{
text-transform:uppercase;
font-family:georgia;
font-size:13px;
color:#DCD3CB;
}

        .onglet_1{
font-weight:bold;
text-transform:uppercase;
font-family:georgia;
font-size:13px;
color:#CCBF7F;
}
        .contenu_onglet{
display:none;
        }
        ul
        {
                margin-top:0px;
                margin-bottom:0px;
                margin-left:-10px
        }

.tf {
font-weight:bold;
font-size:10px;
color:#CCBF7F;
}

.precis {
font-size:9px;
text-align:center;
font-style:italic;
}

fieldset
{
  -moz-border-radius:15px;
-webkit-border-radius:15px;
border-radius:15px;
   background:#FAF9F5;
   margin-bottom:25px;
   padding:20px;
   border:3px solid #ECDED5;
}

legend
{
  -moz-border-radius:15px;
-webkit-border-radius:15px;
border-radius:15px;
   background:#FAF9F5;
   font-variant:small-caps;
   font-weight:bold;
   margin-left:15px;
   padding:3px;
   padding-left:10px;
   padding-right:10px;
   border:2px solid #ECDED5;
   border-bottom:0px;   
font-size: 16px;
text-transform:uppercase;
font-family:georgia;
font-weight: lighter;
color:#E6B171;
margin-bottom:-15px;
text-decoration: none
margin-top:-1px;
}
        </style>

      <script type="text/javascript">
      <!--  //       

function verif(form){
var name = form.name.value;
var image = form.image.value;
var credits = form.credits.value;
var citation = form.citation.value;
var surnoms = form.surnoms.value;
var genre = form.genre.value;
var age = form.age.value;
var dob = form.dob.value;
var lieu = form.lieu.value;
var nationalite = form.nationalite.value;
var sexualite = form.sexualite.value;
var statut = form.statut.value;
var division = form.division.value;
var atterri = form.atterri.value;
var content = form.content.value;
var accueil = form.accueil.value;
var moyenne = form.moyenne.value;
var apres = form.apres.value;
var depuis = form.depuis.value;
var rapport = form.rapport.value;
var profession = form.profession.value;
var collegues = form.collegues.value;
var vision = form.vision.value;
var physique = form.physique.value;
var moralite = form.moralite.value;
var autresinfos = form.autresinfos.value;
var pseudo = form.pseudo.value;
var agemembre = form.agemembre.value;
var presence = form.presence.value;
var perso = form.perso.value;
var forum = form.forum.value;
var coms = form.coms.value;
var mot = form.mot.value;
var ok = true;

if (ok){
var contenu = "[center][img]"+image+"[/img]\n[size=9]"+credits+"[/size]\n\n<div class=\"t1\">"+name+"</div>\n[i]"+citation+"[/i][/center]\n\n<div class="\t2\">Informations Générales</div>\n[b]→ SURNOMS : [/b]"+surnoms+"\n[b]→ ÂGE : [/b]"+age+"\n[b]→ DATE DE NAISSANCE : [/b]"+dob+"\n[b]→ LIEU DE NAISSANCE : [/b]"+lieu+"\n[b]→ NATIONALITÉ : [/b]"+nationalite+"\n[b]→ SEXUALITÉ : [/b]"+sexualite+"\n[b]→ STATUT : [/b]"+statut+"\n[b]→ DIVISION : [/b]"+division+"\n\n\n<div class=\"t2\">Questions/Réponses</div>N\'oubliez pas de supprimer la partie ne vous correspondant pasnn[b]→ COMMENT AVEZ-VOUS ATTERRI ICI ? [/b]"+atterri+"\n[b]→ ES-TU CONTENT DE CE PENSIONNAT ? QUE PENSES-TU DE CELUI-CI ? [/b]"+content+"\n[b]→ L'ACCUEIL, C'ÉTAIT COMMENT POUR TOI ? [/b]"+accueil+"\n[b]→ TA MATIÈRE PRÉFÉRÉE / DÉTESTÉE : [/b]"+matiere+"\n[b]→ MOYENNE GÉNÉRALE : [/b] "+moyenne+"\n[b]→ COMMENT TE VOIS-TU APRÈS TES ÉTUDES ? [/b]"+apres+"\n\n\n[b]→ TU ES ICI DEPUIS QUAND ? [/b]"+depuis+"\n[b]→ TON RAPPORT AVEC LES ÉLÈVES ? [/b]"+rapport+"\n[b]→ POURQUOI AVOIR CHOISI CETTE PROFESSION ? [/b]"+profession+"\n[b]→ TU T'ENTENDS BIEN AVEC TES COLLÈGUES ?[/b]"+collegues+"\n\n\n[b]→ QUE PENSES-TU DU LYCEE ? [/b]"+vision+"\n\n\n<div class=\"t2\">Physique & moralité</div>\n<table width="100%"><tr><td width="50%" valign="top" style="padding-right:10px;">[b]→ PHYSIQUE : [/b]"+physique+"</td><td width="50%" valign="top" style="padding-left:10px;">[b]→ MORALITÉ : [/b]"+moralite+"</td></tr></table>\n\n\n<div class=\"t2\">Autres informations</div>\n"+autresinfos+"\n\n<div class=\"t2\">Derrière l'écran</div>\n[b]→ PSEUDO/PRÉNOM : [/b]"+pseudo+"\n[b]→ ÂGE : [/b]"+agemembre+"\n[b]→ PRÉSENCE : [/b]"+presence+"\n[b]→ AVATAR : [/b]"+perso+"[b]→ OÙ AS TU CONNU LE FORUM ? [/b]"+forum+"\n[b]→ COMMENTAIRES : [/b]"+coms+"\n[b]→ MOT DE LA FIN : [/b][hide]"+mot+"";
document.getElementById("code_genere").value = ""+contenu+"";
}
}

      //-->
      </script>


<div style="padding:20px; font-size:11px;">

<form action="#" method="post" id="rempli">

<fieldset><legend>Informations générales</legend>
<table width="100%">
<tr>
<td width="50%" valign="top" align="center">
<table width="100%">
<tr><td width="50%" align="right"><span class="tf">NOM COMPLET : </span></td><td width="50%"><input type="text" name="name" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">IMAGE : </span></td><td width="50%"><input type="text" name="image" /></td></tr>
<tr><td colspan="2"><div class="precis">Votre image ne devra pas dépasser 550px de largeur.</div></td></tr>
<tr><td width="50%" align="right"><span class="tf">CRÉDITS : </span></td><td width="50%"><input type="text" name="credits" value="(c) ..." /></td></tr>
<tr><td colspan="2"><div class="precis">Mettez ici les crédits de la création de votre image.</div></td></tr>
<tr><td width="50%" align="right"><span class="tf">CITATION : </span></td><td width="50%"><input type="text" name="citation" /></td></tr>
</table>
</td>
<td width="50%" valign="top" align="center">
<table width="100%">
<tr><td width="50%" align="right"><span class="tf">SURNOMS : </span></td><td width="50%"><input type="text" name="surnoms" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">SEXE : </span></td><td width="50%"><select name="genre">
<option>Choisir</option>
        <option value="fille">Fille</option>
        <option value="garcon">Garçon</option>
      </select></td></tr>
<tr><td width="50%" align="right"><span class="tf">ÂGE : </span></td><td width="50%"><input type="text" name="age" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">DATE DE NAISSANCE : </span></td><td width="50%"><input type="text" name="dob" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">LIEU DE NAISSANCE : </span></td><td width="50%"><input type="text" name="lieu" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">NATIONALITÉ : </span></td><td width="50%"><input type="text" name="nationalite" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">SEXUALITÉ : </span></td><td width="50%"><select name="sexualite">
        <option value="nonpre">Non précisé</option>
        <option value="hetero">Hétérosexuel(le)</option>
        <option value="bi">Bisexuel(le)</option>
<option value="homo">Homosexuel(le)</option>
      </select></td></tr>
<tr><td width="50%" align="right"><span class="tf">STATUT : </span></td><td width="50%"><input type="text" name="statut" /></td></tr>
<tr><td colspan="2"><div class="precis">Élève, professeur, membre du personnel. Si professeur ou mdp, préciser la spécialité (ex; prof de maths, surveillant)</div></td></tr>
<tr><td width="50%" align="right"><span class="tf">DIVISION : </span></td><td width="50%"><input type="text" name="division" /></td></tr>
<tr><td colspan="2"><div class="precis">pour les élèves. Au choix entre ; Sportifs, Artistes, Mode, Rebelles, Originaux, Gamers, Genies. Divisions consultables <a href="http://ehime.1fr1.net/t25-les-divisions#26" target="_blank">ici</a>.
</div></td></tr></table>
</td>
</tr>
</table>

</fieldset>
<br />

<fieldset><legend>Questions/Réponses</legend>
        <div class="onglets">
            <span class="onglet_0 onglet" id="onglet_eleves" onclick="javascript:change_onglet('eleves');">Élèves</span>
            <span class="onglet_0 onglet" id="onglet_profsmdp" onclick="javascript:change_onglet('profsmdp');">Membres du personnel/Professeurs</span>
            <span class="onglet_0 onglet" id="onglet_citadins" onclick="javascript:change_onglet('citadins');">Citadins</span>
        </div>
<table width="100%">
<tr>
<td width="25%" valign="top">
<div style="text-align:justify; padding-right:10px;">Dans cette partie, vous devrez répondre avec précision aux questions posées. En fonction de votre statut (élève, membre du personnel/professeur ou citadin), vous pourrez choisir votre partie en cliquant au dessus sur le groupe qui vous correspond. Nous ne demandons aucun nombre de lignes dans cette partie et il n'y a pas de maximum, néanmoins, comme nous ne demandons pas d'histoire, il serait appréciable que vous développiez un peu vos réponses.</div>
</td>
<td width="75%" valign="top">
        <div class="contenu_onglets">
            <div class="contenu_onglet" id="contenu_onglet_eleves">
<table width="100%">
<tr><td width="50%" valign="top"><span class="tf">COMMENT AVEZ-VOUS ATTERRI ICI ?</span>
<br /><textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="atterri"></textarea></td><td width="50%"><span class="tf">ES-TU CONTENT DE CE PENSIONNAT ?</span>
<br /><textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="content"></textarea></td></tr>
<tr><td width="50%" valign="top"><span class="tf">L'ACCUEIL, C'ÉTAIT COMMENT POUR TOI ?</span><br />
<textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="accueil"></textarea>
</td><td width="50%"><span class="tf">TA MATIÈRE PRÉFÉRÉE / DÉTESTÉE :</span><br />
<textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="matiere"></textarea></td></tr>
<tr><td width="50%" valign="top"><span class="tf"><span class="tf">MOYENNE GÉNÉRALE : </span>
<br />
<textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="moyenne">.../20, </textarea></td><td width="50%"><span class="tf">COMMENT TE VOIS-TU APRÈS TES ÉTUDES ?</span>
<br />
<textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="apres"></textarea></td></tr>
</table>
            </div>

            <div class="contenu_onglet" id="contenu_onglet_profsmdp">
<table width="100%">
<tr><td width="50%" valign="top"><span class="tf">TU ES ICI DEPUIS QUAND ? </span>
<br /><textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="depuis"></textarea></td><td width="50%"><span class="tf">TON RAPPORT AVEC LES ÉLÈVES ? </span>
<br /><textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="rapport"></textarea></td></tr>
<tr><td width="50%" valign="top"><span class="tf">POURQUOI CETTE PROFESSION ? </span><br />
<textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="profession"></textarea>
</td><td width="50%"><span class="tf">TU T'ENTENDS BIEN AVEC TES COLLÈGUES ?</span><br />
<textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="collegues"></textarea></td></tr>
</table>
            </div>

            <div class="contenu_onglet" id="contenu_onglet_citadins">
<table width="100%">
<tr><td width="50%" valign="top"><span class="tf">QUE PENSES-TU DU LYCEE ?</span>
<br /><textarea style="width:530px; height:200px;margin-bottom:19px;font-size:11px;" rows="4" name="vision"></textarea></td></tr>
</table>
            </div>
        </div>
    </div>
</td>
</tr>
</table>

</fieldset>


<fieldset><legend>Physique et moralité</legend>
<blockquote><div style="text-align:justify;">Nous ne demandons pas de minimum de lignes pour chaque description, déjà parce qu'étant donné qu'elles sont dans un tableau, celles-ci peuvent être faussées, ensuite parce qu'on préfère vous laisser libre dans l'écriture de celle-ci. Évitez tout de même de vous contenter de donner quelques adjectifs; développez un peu vos parties (; <b>NÉANMOINS</b>, les pavés de 150 lignes par description sont maintenant interdit ! N'en faites pas trop non plus, sinon nous vous demanderons de revoir vos descriptions.</div></blockquote>
<table width="100%">
<tr><td width="50%" valign="top"><span class="tf">PHYSIQUE : </span>
<br /><textarea style="width:360px; height:150px; margin-bottom:19px;font-size:11px;" rows="4" name="physique">Écrire ici le physique de votre personnage. Mettez l'accent sur son style vestimentaire, sa façon de se tenir etc.. car pour ce qui est du reste, on peut le voir sur l'avatar (:</textarea></td>
<td width="50%" valign="top"><span class="tf">MORALITÉ : </span>
<br /><textarea style="width:360px;height:150px; margin-bottom:19px;font-size:11px;" rows="4" name="moralite">Écrire ici la moralité de votre personnage. Sa façon de se comporter avec les gens, ses qualités & défauts, ce qu'il aime ou n'aime pas, ses forces, ses faiblesses, ses craintes...</textarea></td></tr>
</table></fieldset>

<fieldset><legend>Autres informations</legend>
<blockquote><div style="text-align:justify;">Partie facultative, mais qui peut s'avérer utile. Mettez ici toute les informations qui pourront nous aider à comprendre votre personnage, ce qu'il aime ou ce qu'il n'aime pas, des trucs que vous n'avez pu caser nul part quoi... Vous pouvez également y ajouter l'histoire de votre personnage ou un passage qui l'aura particulièrement marqué au cours de sa vie si vous le souhaitez mais celle-ci est totalement facultative, nous ne vous imposons rien là dessus.</div></blockquote>
<center><textarea style="width:600px; height:150px; margin-bottom:19px;font-size:11px;" rows="4" name="autresinfos"></textarea></center></fieldset>

<fieldset><legend>Derrière l'écran</legend>
<table width="100%">
<tr><td width="50%">
<table width="100%">
<tr><td width="50%" align="right"><span class="tf">PSEUDO/PRÉNOM : </span></td><td width="50%"><input type="text" name="pseudo" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">ÂGE : </span></td><td width="50%"><input type="text" name="agemembre" /> ans</td></tr>
<tr><td width="50%" align="right"><span class="tf">PRÉSENCE : </span></td><td width="50%"><input type="text" name="presence" value=".../7" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">PERSONNAGE SUR L'AVATAR : </span></td><td width="50%"><input type="text" name="perso" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">OÙ AS TU CONNU LE FORUM ? : </span></td><td width="50%"><input type="text" name="forum" /></td></tr></table>
</td>
<td width="50%" valign="top">
<span class="tf">COMMENTAIRES SUR EHIME : </span><br />
<textarea style="width:350px; height:75px; margin-bottom:19px;font-size:11px;" rows="4" name="coms">Cette partie est libre. Si vous avez des commentaires à ajouter sur le forum, vous pourrez le faire ici. N'oubliez pas de lire les informations de la fiche, sinon vous ne serez pas validé.</textarea><br />
<span class="tf">LE MOT DE LA FIN : <input type="text" name="mot" /></td>
</tr>
</table></fieldset>

</form>

<fieldset><legend>Récpérer le code</legend><center><input type="button" onClick="collecte(this.form)" value="Generer le code" /> <input type="button" value="Selectionner le code" onClick="javascript:document.getElementById('code_genere').select();"><br /><br />
<textarea style="width:600px; height:250px; margin-bottom:19px;font-size:11px;" rows="4" id="code_genere" readonly></textarea></center>
</fieldset>

</div>

    <script type="text/javascript">
        //<!--
                var anc_onglet = 'eleves';
                change_onglet(anc_onglet);
        //-->
        </script>

</body>
</html>

Je remercie la personne qui saura me répondre : )


Dernière édition par Leziel le Dim 29 Juil 2012 - 23:56, édité 2 fois
avatar

Leziel
Nouveau membre

Messages : 8
Inscrit(e) le : 29/07/2012

http://ehime.1fr1.net
Leziel a été remercié(e) par l'auteur de ce sujet.
  • 0

Résolu Re: [Problème] Formulaire qui génère un code BBcode

Message par _backdraft_ Dim 29 Juil 2012 - 18:01

Bonjour,

Vous devriez enlever la balise hide car peu de personne ne pourront vous aider puisqu'il faut poster un message pour le voir.

Cordialement
_backdraft_

_backdraft_
Membre habitué

Masculin
Messages : 1509
Inscrit(e) le : 04/03/2010

http://www.caserne35.com
_backdraft_ a été remercié(e) par l'auteur de ce sujet.

Résolu Re: [Problème] Formulaire qui génère un code BBcode

Message par Leziel Dim 29 Juil 2012 - 22:39

Je n'y avais en effet pas pensé. J'ai enlevé la balise hide !
avatar

Leziel
Nouveau membre

Messages : 8
Inscrit(e) le : 29/07/2012

http://ehime.1fr1.net
Leziel a été remercié(e) par l'auteur de ce sujet.

Résolu Re: [Problème] Formulaire qui génère un code BBcode

Message par Scoubifitz Dim 29 Juil 2012 - 22:52

bonsoir,

c'est mieux comme ça ...

le code corrigé :

Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Generateur de presentation</title>
<script type="text/javascript">
<!--//
function change_onglet(name)
{
document.getElementById('onglet_'+anc_onglet).className = 'onglet_0 onglet';
document.getElementById('onglet_'+name).className = 'onglet_1 onglet';
document.getElementById('contenu_onglet_'+anc_onglet).style.display = 'none';
document.getElementById('contenu_onglet_'+name).style.display = 'block';
anc_onglet = name;
}
//-->
</script>
<style type="text/css">
<!--
.onglets {
   text-align:center;
}
.onglet {
   display:inline-block;
   margin-left:3px;
   margin-right:3px;
   padding:3px;
   cursor:pointer;
}
.onglet_0{
   text-transform:uppercase;
   font-family:georgia;
   font-size:13px;
   color:#DCD3CB;
}
.onglet_1{
   font-weight:bold;
   text-transform:uppercase;
   font-family:georgia;
   font-size:13px;
   color:#CCBF7F;
}
.contenu_onglet{
   display:none;
}
ul{
   margin-top:0px;
   margin-bottom:0px;
   margin-left:-10px;
}
.tf {
   font-weight:bold;
   font-size:10px;
   color:#CCBF7F;
}
.precis {
   font-size:9px;
   text-align:center;
   font-style:italic;
}
fieldset{
   -moz-border-radius:15px;
   -webkit-border-radius:15px;
   border-radius:15px;
   background:#FAF9F5;
   margin-bottom:25px;
   padding:20px;
   border:3px solid #ECDED5;
}
legend{
   -moz-border-radius:15px;
   -webkit-border-radius:15px;
   border-radius:15px;
   background:#FAF9F5;
   font-variant:small-caps;
   font-weight:bold;
   margin-left:15px;
   padding:3px;
   padding-left:10px;
   padding-right:10px;
   border:2px solid #ECDED5;
   border-bottom:0px;
   font-size: 16px;
   text-transform:uppercase;
   font-family:georgia;
   font-weight: lighter;
   color:#E6B171;
   margin-bottom:-15px;
   text-decoration: none;
   margin-top:-1px;
}
-->
</style>
<script type="text/javascript">
//<!--
function collecte(form){
var name = form.name.value;
var image = form.image.value;
var credits = form.credits.value;
var citation = form.citation.value;
var surnoms = form.surnoms.value;
var genre = form.genre.value;
var age = form.age.value;
var dob = form.dob.value;
var lieu = form.lieu.value;
var nationalite = form.nationalite.value;
var sexualite = form.sexualite.value;
var statut = form.statut.value;
var division = form.division.value;
var atterri = form.atterri.value;
var content = form.content.value;
var accueil = form.accueil.value;
var matiere = form.matiere.value;
var moyenne = form.moyenne.value;
var apres = form.apres.value;
var depuis = form.depuis.value;
var rapport = form.rapport.value;
var profession = form.profession.value;
var collegues = form.collegues.value;
var vision = form.vision.value;
var physique = form.physique.value;
var moralite = form.moralite.value;
var autresinfos = form.autresinfos.value;
var pseudo = form.pseudo.value;
var agemembre = form.agemembre.value;
var presence = form.presence.value;
var perso = form.perso.value;
var forum = form.forum.value;
var coms = form.coms.value;
var mot = form.mot.value;
var ok = true;

if (ok){
var contenu = "[center][img]"+image+"[/img]\n[size=9]"+credits+"[/size]\n\n<div class=\"t1\">"+name+"</div>\n[i]"+citation+"[/i][/center]\n\n<div class=\"t2\">Informations Générales</div>\n[b]? SURNOMS : [/b]"+surnoms+"\n[b]? ÂGE : [/b]"+age+"\n[b]? DATE DE NAISSANCE : [/b]"+dob+"\n[b]? LIEU DE NAISSANCE : [/b]"+lieu+"\n[b]? NATIONALITÉ : [/b]"+nationalite+"\n[b]? SEXUALITÉ : [/b]"+sexualite+"\n[b]? STATUT : [/b]"+statut+"\n[b]? DIVISION : [/b]"+division+"\n\n\n<div class=\"t2\">Questions/Réponses</div>N\'oubliez pas de supprimer la partie ne vous correspondant pasnn[b]? COMMENT AVEZ-VOUS ATTERRI ICI ? [/b]"+atterri+"\n[b]? ES-TU CONTENT DE CE PENSIONNAT ? QUE PENSES-TU DE CELUI-CI ? [/b]"+content+"\n[b]? L'ACCUEIL, C'ÉTAIT COMMENT POUR TOI ? [/b]"+accueil+"\n[b]? TA MATIÈRE PRÉFÉRÉE / DÉTESTÉE : [/b]"+matiere+"\n[b]? MOYENNE GÉNÉRALE : [/b] "+moyenne+"\n[b]? COMMENT TE VOIS-TU APRÈS TES ÉTUDES ? [/b]"+apres+"\n\n\n[b]? TU ES ICI DEPUIS QUAND ? [/b]"+depuis+"\n[b]? TON RAPPORT AVEC LES ÉLÈVES ? [/b]"+rapport+"\n[b]? POURQUOI AVOIR CHOISI CETTE PROFESSION ? [/b]"+profession+"\n[b]? TU T'ENTENDS BIEN AVEC TES COLLÈGUES ?[/b]"+collegues+"\n\n\n[b]? QUE PENSES-TU DU LYCEE ? [/b]"+vision+"\n\n\n<div class=\"t2\">Physique & moralité</div>\n<table width=\"100%\"><tr><td width=\"50%\" valign=\"top\" style=\"padding-right:10px;\">[b]? PHYSIQUE : [/b]"+physique+"</td><td width=\"50%\" valign=\"top\" style=\"padding-left:10px;\">[b]? MORALITÉ : [/b]"+moralite+"</td></tr></table>\n\n\n<div class=\"t2\">Autres informations</div>\n"+autresinfos+"\n\n<div class=\"t2\">Derrière l'écran</div>\n[b]? PSEUDO/PRÉNOM : [/b]"+pseudo+"\n[b]? ÂGE : [/b]"+agemembre+"\n[b]? PRÉSENCE : [/b]"+presence+"\n[b]? AVATAR : [/b]"+perso+"[b]? OÙ AS TU CONNU LE FORUM ? [/b]"+forum+"\n[b]? COMMENTAIRES : [/b]"+coms+"\n[b]? MOT DE LA FIN : [/b][hide]"+mot+"";
document.getElementById("code_genere").value = ""+contenu+"";
}
}
//-->
</script>
</head>
<body>
<div style="padding:20px; font-size:11px;">
<form action="#" method="post" id="rempli">

<fieldset><legend>Informations générales</legend>
<table width="100%">
<tr>
<td width="50%" valign="top" align="center">
<table width="100%">
<tr><td width="50%" align="right"><span class="tf">NOM COMPLET : </span></td><td width="50%"><input type="text" name="name" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">IMAGE : </span></td><td width="50%"><input type="text" name="image" /></td></tr>
<tr><td colspan="2"><div class="precis">Votre image ne devra pas dépasser 550px de largeur.</div></td></tr>
<tr><td width="50%" align="right"><span class="tf">CRÉDITS : </span></td><td width="50%"><input type="text" name="credits" value="(c) ..." /></td></tr>
<tr><td colspan="2"><div class="precis">Mettez ici les crédits de la création de votre image.</div></td></tr>
<tr><td width="50%" align="right"><span class="tf">CITATION : </span></td><td width="50%"><input type="text" name="citation" /></td></tr>
</table>
</td>
<td width="50%" valign="top" align="center">
<table width="100%">
<tr><td width="50%" align="right"><span class="tf">SURNOMS : </span></td><td width="50%"><input type="text" name="surnoms" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">SEXE : </span></td><td width="50%"><select name="genre">
<option>Choisir</option>
<option value="fille">Fille</option>
<option value="garcon">Garçon</option>
</select></td></tr>
<tr><td width="50%" align="right"><span class="tf">ÂGE : </span></td><td width="50%"><input type="text" name="age" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">DATE DE NAISSANCE : </span></td><td width="50%"><input type="text" name="dob" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">LIEU DE NAISSANCE : </span></td><td width="50%"><input type="text" name="lieu" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">NATIONALITÉ : </span></td><td width="50%"><input type="text" name="nationalite" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">SEXUALITÉ : </span></td><td width="50%"><select name="sexualite">
<option value="nonpre">Non précisé</option>
<option value="hetero">Hétérosexuel(le)</option>
<option value="bi">Bisexuel(le)</option>
<option value="homo">Homosexuel(le)</option>
</select></td></tr>
<tr><td width="50%" align="right"><span class="tf">STATUT : </span></td><td width="50%"><input type="text" name="statut" /></td></tr>
<tr><td colspan="2"><div class="precis">Élève, professeur, membre du personnel. Si professeur ou mdp, préciser la spécialité (ex; prof de maths, surveillant)</div></td></tr>
<tr><td width="50%" align="right"><span class="tf">DIVISION : </span></td><td width="50%"><input type="text" name="division" /></td></tr>
<tr><td colspan="2"><div class="precis">pour les élèves. Au choix entre ; Sportifs, Artistes, Mode, Rebelles, Originaux, Gamers, Genies. Divisions consultables <a href="http://ehime.1fr1.net/t25-les-divisions#26" target="_blank">ici</a>.
</div></td></tr></table>
</td>
</tr>
</table>

</fieldset>
<br />

<fieldset><legend>Questions/Réponses</legend>
<div class="systeme_onglets">
<div class="onglets">
<span class="onglet_0 onglet" id="onglet_quoi" onclick="javascript:change_onglet('quoi');">Élèves</span>
<span class="onglet_0 onglet" id="onglet_qui" onclick="javascript:change_onglet('qui');">Membres du personnel/Professeurs</span>
<span class="onglet_0 onglet" id="onglet_pourquoi" onclick="javascript:change_onglet('pourquoi');">Citadins</span>
</div>
<table width="100%">
<tr>
<td width="25%" valign="top">
<div style="text-align:justify; padding-right:10px;">Dans cette partie, vous devrez répondre avec précision aux questions posées. En fonction de votre statut (élève, membre du personnel/professeur ou citadin), vous pourrez choisir votre partie en cliquant au dessus sur le groupe qui vous correspond. Nous ne demandons aucun nombre de lignes dans cette partie et il n'y a pas de maximum, néanmoins, comme nous ne demandons pas d'histoire, il serait appréciable que vous développiez un peu vos réponses.</div>
</td>
<td width="75%" valign="top">
<div class="contenu_onglets">
<div class="contenu_onglet" id="contenu_onglet_quoi">
<table width="100%">
<tr><td width="50%" valign="top"><span class="tf">COMMENT AVEZ-VOUS ATTERRI ICI ?</span>
<br /><textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="atterri"></textarea></td><td width="50%"><span class="tf">ES-TU CONTENT DE CE PENSIONNAT ?</span>
<br /><textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="content"></textarea></td></tr>
<tr><td width="50%" valign="top"><span class="tf">L'ACCUEIL, C'ÉTAIT COMMENT POUR TOI ?</span><br />
<textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="accueil"></textarea>
</td><td width="50%"><span class="tf">TA MATIÈRE PRÉFÉRÉE / DÉTESTÉE :</span><br />
<textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="matiere"></textarea></td></tr>
<tr><td width="50%" valign="top"><span class="tf">MOYENNE GÉNÉRALE : </span>
<br />
<textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="moyenne">.../20, </textarea></td><td width="50%"><span class="tf">COMMENT TE VOIS-TU APRÈS TES ÉTUDES ?</span>
<br />
<textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="apres"></textarea></td></tr>
</table>
</div>

<div class="contenu_onglet" id="contenu_onglet_qui">
<table width="100%">
<tr><td width="50%" valign="top"><span class="tf">TU ES ICI DEPUIS QUAND ? </span>
<br /><textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="depuis"></textarea></td><td width="50%"><span class="tf">TON RAPPORT AVEC LES ÉLÈVES ? </span>
<br /><textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="rapport"></textarea></td></tr>
<tr><td width="50%" valign="top"><span class="tf">POURQUOI CETTE PROFESSION ? </span><br />
<textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="profession"></textarea>
</td><td width="50%"><span class="tf">TU T'ENTENDS BIEN AVEC TES COLLÈGUES ?</span><br />
<textarea style="width:260px;margin-bottom:19px;font-size:11px;" rows="4" name="collegues"></textarea></td></tr>
</table>
</div>

<div class="contenu_onglet" id="contenu_onglet_pourquoi">
<table width="100%">
<tr><td width="50%" valign="top"><span class="tf">QUE PENSES-TU DU LYCEE ?</span>
<br /><textarea style="width:530px; height:200px;margin-bottom:19px;font-size:11px;" rows="4" name="vision"></textarea></td></tr>
</table>
</div>
</div>
</td>
</tr>
</table>

</div>
</fieldset>


<fieldset><legend>Physique et moralité</legend>
<blockquote><div style="text-align:justify;">Nous ne demandons pas de minimum de lignes pour chaque description, déjà parce qu'étant donné qu'elles sont dans un tableau, celles-ci peuvent être faussées, ensuite parce qu'on préfère vous laisser libre dans l'écriture de celle-ci. Évitez tout de même de vous contenter de donner quelques adjectifs; développez un peu vos parties (; <b>NÉANMOINS</b>, les pavés de 150 lignes par description sont maintenant interdit ! N'en faites pas trop non plus, sinon nous vous demanderons de revoir vos descriptions.</div></blockquote>
<table width="100%">
<tr><td width="50%" valign="top"><span class="tf">PHYSIQUE : </span>
<br /><textarea style="width:360px; height:150px; margin-bottom:19px;font-size:11px;" rows="4" name="physique">Écrire ici le physique de votre personnage. Mettez l'accent sur son style vestimentaire, sa façon de se tenir etc.. car pour ce qui est du reste, on peut le voir sur l'avatar (:</textarea></td>
<td width="50%" valign="top"><span class="tf">MORALITÉ : </span>
<br /><textarea style="width:360px;height:150px; margin-bottom:19px;font-size:11px;" rows="4" name="moralite">Écrire ici la moralité de votre personnage. Sa façon de se comporter avec les gens, ses qualités & défauts, ce qu'il aime ou n'aime pas, ses forces, ses faiblesses, ses craintes...</textarea></td></tr>
</table></fieldset>

<fieldset><legend>Autres informations</legend>
<blockquote><div style="text-align:justify;">Partie facultative, mais qui peut s'avérer utile. Mettez ici toute les informations qui pourront nous aider à comprendre votre personnage, ce qu'il aime ou ce qu'il n'aime pas, des trucs que vous n'avez pu caser nul part quoi... Vous pouvez également y ajouter l'histoire de votre personnage ou un passage qui l'aura particulièrement marqué au cours de sa vie si vous le souhaitez mais celle-ci est totalement facultative, nous ne vous imposons rien là dessus.</div></blockquote>
<center><textarea style="width:600px; height:150px; margin-bottom:19px;font-size:11px;" rows="4" name="autresinfos"></textarea></center></fieldset>

<fieldset><legend>Derrière l'écran</legend>
<table width="100%">
<tr><td width="50%">
<table width="100%">
<tr><td width="50%" align="right"><span class="tf">PSEUDO/PRÉNOM : </span></td><td width="50%"><input type="text" name="pseudo" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">ÂGE : </span></td><td width="50%"><input type="text" name="agemembre" /> ans</td></tr>
<tr><td width="50%" align="right"><span class="tf">PRÉSENCE : </span></td><td width="50%"><input type="text" name="presence" value=".../7" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">PERSONNAGE SUR L'AVATAR : </span></td><td width="50%"><input type="text" name="perso" /></td></tr>
<tr><td width="50%" align="right"><span class="tf">OÙ AS TU CONNU LE FORUM ? : </span></td><td width="50%"><input type="text" name="forum" /></td></tr></table>
</td>
<td width="50%" valign="top">
<span class="tf">COMMENTAIRES SUR EHIME : </span><br />
<textarea style="width:350px; height:75px; margin-bottom:19px;font-size:11px;" rows="4" name="coms">Cette partie est libre. Si vous avez des commentaires à ajouter sur le forum, vous pourrez le faire ici. N'oubliez pas de lire les informations de la fiche, sinon vous ne serez pas validé.</textarea><br />
<span class="tf">LE MOT DE LA FIN : </span><input type="text" name="mot" /></td>
</tr>
</table></fieldset>

<fieldset><legend>Récpérer le code</legend><center><input type="button" onClick="collecte(this.form)" value="Generer le code" /> <input type="button" value="Selectionner le code" onClick="javascript:document.getElementById('code_genere').select();" /><br /><br />
<textarea style="width:600px; height:250px; margin-bottom:19px;font-size:11px;" rows="4" id="code_genere" readonly="readonly"></textarea></center>
</fieldset>

</form>
</div>

<script type="text/javascript">
//<!--
var anc_onglet = 'quoi';
change_onglet(anc_onglet);
//-->
</script>

</body>
</html>
Scoubifitz

Scoubifitz
Membre actif

Masculin
Messages : 3687
Inscrit(e) le : 18/03/2008

http://scoubidous.superforum.fr/
Scoubifitz a été remercié(e) par l'auteur de ce sujet.

Résolu Re: [Problème] Formulaire qui génère un code BBcode

Message par Leziel Dim 29 Juil 2012 - 23:29

Merci beaucoup pour ta rapidité, le code marche à merveille ! Néanmoins avant de classer comme résolu, serait-il possible que tu me dises où se trouvait l'erreur s'il te plait ? C'est toujours bon de savoir, histoire que j'évite de la faire la prochaine fois
avatar

Leziel
Nouveau membre

Messages : 8
Inscrit(e) le : 29/07/2012

http://ehime.1fr1.net
Leziel a été remercié(e) par l'auteur de ce sujet.

Résolu Re: [Problème] Formulaire qui génère un code BBcode

Message par Scoubifitz Dim 29 Juil 2012 - 23:39

quelques erreurs de guillemets qui n'étaient pas anti-slashés dans la variable "contenu" ,

il manquait "matiere" , des "span" en double ou pas fermés , des "div" mal placés , et enfin ,

le bouton "générer le code" appelait la fonction "collecte" , alors que tu définissais une fonction "vérif" ... Siffleur

Scoubifitz

Scoubifitz
Membre actif

Masculin
Messages : 3687
Inscrit(e) le : 18/03/2008

http://scoubidous.superforum.fr/
Scoubifitz a été remercié(e) par l'auteur de ce sujet.

Résolu Re: [Problème] Formulaire qui génère un code BBcode

Message par Leziel Dim 29 Juil 2012 - 23:55

Oui en effet, après avoir relu ton code et le mien je me suis aperçu des anti-slash lol

Merci beaucoup d'avoir pris le temps de corriger mon code en tous cas, c'est vraiment gentil.

Problème résolu !
avatar

Leziel
Nouveau membre

Messages : 8
Inscrit(e) le : 29/07/2012

http://ehime.1fr1.net
Leziel a été remercié(e) par l'auteur de ce sujet.

Voir le sujet précédent Voir le sujet suivant Revenir en haut

- Sujets similaires

Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum