stealth35 | par exemple
Code :
- <?php
- if(!empty($_POST)){
- print_r($_POST);
- // Traitement PHP
- exit;
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>Email</title>
- <script type="text/javascript">var djConfig = {isDebug:true, parseOnLoad:false, dojoBlankHtmlUrl:"blank.html"};</script>
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.2.3/dojo/dojo.xd.js"></script>
- <script type="text/javascript">dojo.addOnLoad(function(){dojo.addClass(dojo.body(),"tundra" );});</script>
- <style type="text/css" media="all">
- @import "http://ajax.googleapis.com/ajax/libs/dojo/1.2.3/dijit/themes/tundra/tundra.css";
- @import "http://ajax.googleapis.com/ajax/libs/dojo/1.2.3/dojo/resources/dojo.css";
- #server-dialog .dijitDialogTitleBar {
- display:none;
- }
- #spanreturn{
- padding:5px;
- }
- form fieldset{
- width:640px;
- margin:25px auto 0 auto;
- border:1px solid #d0d0d0;
- padding:5px;
- }
- form legend{
- font-size:16px;
- font-weight:bold;
- }
- form table td{
- vertical-align:top;
- padding:2px;
- }
- </style>
- </head>
- <body>
- <script type="text/javascript">
- // <![CDATA[
- dojo.require("dojo.parser" );
- dojo.require("dijit.Dialog" );
- dojo.require("dijit.Editor" );
- dojo.require("dijit.form.Form" );
- dojo.require("dijit.form.TextBox" );
- dojo.require("dijit.form.ValidationTextBox" );
- dojo.require("dijit.form.CheckBox" );
- var domDijits = [
- {"id":"server-dialog","params":{"dojoType":"dijit.Dialog"}},
- {"id":"envoi","params":{"dojoType":"dijit.form.Form"}},
- {"id":"nomaffaire","params":{"dojoType":"dijit.form.ValidationTextBox", "required":"true"}},
- {"id":"nom","params":{"dojoType":"dijit.form.ValidationTextBox", "required":"true"}},
- {"id":"prenom","params":{"dojoType":"dijit.form.ValidationTextBox", "required":"true"}},
- {"id":"adresse","params":{"dojoType":"dijit.form.ValidationTextBox", "required":"true"}},
- {"id":"siteweb","params":{"dojoType":"dijit.form.ValidationTextBox", "required":"true"}},
- {"id":"lat","params":{"dojoType":"dijit.form.TextBox"}},
- {"id":"lon","params":{"dojoType":"dijit.form.TextBox"}},
- {"id":"choix1","params":{"dojoType":"dijit.form.CheckBox"}},
- {"id":"choix2","params":{"dojoType":"dijit.form.CheckBox"}},
- {"id":"choix3","params":{"dojoType":"dijit.form.CheckBox"}},
- {"id":"choix4","params":{"dojoType":"dijit.form.CheckBox"}},
- {"id":"choix5","params":{"dojoType":"dijit.form.CheckBox"}},
- {"id":"choix6","params":{"dojoType":"dijit.form.CheckBox"}},
- {"id":"description","params":{"dojoType":"dijit.Editor", "height":"150"}},
- {"id":"form-submit","params":{"dojoType":"dijit.form.Button", "iconClass":"dijitEditorIcon dijitEditorIconSave"}}
- ];
- dojo.addOnLoad(function(){
- dojo.forEach(domDijits, function(info) {
- var n = dojo.byId(info.id);
- if (null != n) {
- dojo.attr(n, dojo.mixin({ id: info.id }, info.params));
- }
- });
- dojo.parser.parse();
- });
- var submitForm = function(form){
- var kw = {
- url: form.action,
- load: function(data){
- dojo.byId('spanreturn').innerHTML = data;
- dojo.anim(null, { }, 1500, null, function(){
- dijit.byId('server-dialog').hide();
- });
- },
- error: function(data){
- alert("An error occurred: ", data);
- },
- content: form.getValues()
- };
- form.validate();
- if(form.isValid()){
- dijit.byId('server-dialog').show();
- dojo.xhrPost(kw);
- }
- }
- // ]]>
- </script>
- <div id="server-dialog" style="display:none; width:275px;" title="loading...">
- <table>
- <tr>
- <td><img src="images/ajax-loader-big.gif" alt="Loading..." /></td>
- <td><span id="spanreturn">Enregistrement en cours...</span></td>
- </tr>
- </table>
- </div>
- <form id="envoi" action="req.php" method="post" onsubmit="submitForm(this); return false;">
- <fieldset>
- <legend>Formulaire</legend>
- <table>
- <tr><td>Nom d'affaire :</td><td><input type="text" id="nomaffaire" name="nomaffaire" /></td></tr>
- <tr><td>Nom :</td><td><input type="text" id="nom" name="nom" /></td></tr>
- <tr><td>Prenom :</td><td><input type="text" id="prenom" name="prenom" /></td></tr>
- <tr><td>Adresse :</td><td><input type="text" id="adresse" name="adresse" /></td></tr>
- <tr><td>Site-Web :</td><td><input type="text" id="siteweb" name="siteweb" /></td></tr>
- <tr><td>Latitude :</td><td><input type="text" id="lat" name="lat" value="" /></td></tr>
- <tr><td>Longitude :</td><td><input type="text" id="lon" name="lon" value="" /></td></tr>
- <tr><td>Domaine d"activité :</td><td><input type="checkbox" id="choix1" name="choix[]" value="1" /><label for="choix1">Fruits et légumes</label>
- <br /><input type="checkbox" id="choix2" name="choix[]" value="2" /><label for="choix2">Produits laitiers/fromages</label>
- <br /><input type="checkbox" id="choix3" name="choix[]" value="3" /><label for="choix3">Viande</label>
- <br /><input type="checkbox" id="choix4" name="choix[]" value="4" /><label for="choix4">Produits transformés/divers</label>
- <br /><input type="checkbox" id="choix5" name="choix[]" value="5" /><label for="choix5">Artisanat/divers</label>
- <br /><input type="checkbox" id="choix6" name="choix[]" value="6" /><label for="choix6">Economie solidaire</label></td></tr>
- <tr><td>Description :</td><td><textarea rows="3" cols="40" id="description" name="description"></textarea></td></tr>
- <tr><td></td><td></td></tr>
- <tr><td colspan="2" style="text-align:center;"><button type="submit" id="form-submit">Enregistrer</button></td></tr>
- </table>
- </fieldset>
- </form>
- </body>
- </html>
|
Message édité par stealth35 le 16-03-2009 à 18:14:04
|