1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
| <head>
<script language="javascript" type="text/javascript" src="js/mootools.js"></script>
<script language="javascript" type="text/javascript" src="js/forms.js"></script>
<script language="javascript" type="text/javascript" src="js/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
language : "fr",
plugins : "fullscreen,ibrowser",
theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,|,fontselect,fontsizeselect,|,bullist,numlist,|,outdent,indent,blockquote,|,link,unlink,|,forecolor,|,fullscreen,|,ibrowser",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "center",
theme_advanced_resizing : true,
relative_urls : false
});
window.addEvent('load', initRequest);
function initRequest() {
var envoi = $('envoi_redaction');
envoi.addEvent('click', sendform_redaction);
}
function sendform_redaction(e) {
if (checkform('form_redaction') == true) {
// capture de lévénement
var myEvent = new Event(e);
// on le eutralise
myEvent.stop();
var log = $('res_redaction').empty().addClass('ajax-loading');
var url = "validation/valid_redaction.php";
new Ajax (url, {
method:'post',
update: log,
data:document.forms[0],
encoding:'utf-8',
onComplete: function() {
log.removeClass('ajax-loading');
}
}).request();
}
}
function checkform(formname) {
var errors = 0;
errors += checkText(formname, 'titre');
if (errors == 0) {
return true;
}
else {
return false;
}
}
</script>
</head>
<body>
<div class="contenu">
<?php
include_once('inc/menu_admin.php');
include_once('js/tiny_mce/plugins/ibrowser/config/config.inc.php');
?>
<form method="post" name="form_redaction" action="validation/valid_redaction.php" id="form_redaction">
<label for="document" class="label_form">
Type de document :
<select name="document" id="document" class="select_form">
<option value="article">Article</option>
<option value="dossier">Dossier</option>
</select>
</label>
<label for="categorie" class="label_form">
Catégorie :
<select name="categorie" id="categorie" class="select_form">
<option value="1">Les sorties</option>
<option value="2">L'Association</option>
<option value="3">La Fédération</option>
</select>
</label>
<label for="titre" class="label_form">
Titre : <input type="text" name="titre" id="titre" size="35" class="input_form" maxlength="50" />
<div id="erreur_titre" class="erreur_form">Veuillez indiquer un titre</div>
</label>
<label class="label_form" style="height:385px;">
Contenu :<br /><br />
<textarea name="contenu_redaction" id="contenu_redaction" cols="93" rows="20"></textarea>
<div id="erreur_contenu" class="erreur_form">Veuillez ajouter du contenu</div>
</label>
<div class="centre">
<a href="#"><img src="img/boutons/envoyer.jpg" alt="Envoyer" id="envoi_redaction" /></a>
<a href="#" onclick="document.forms.form_redaction.reset();"><img src="img/boutons/effacer.jpg" alt="Effacer" /></a>
</div>
</form> |
Partager