Cosi dovrebbe andare, dalle prove che ho fatto in locale con ff3 e ie7 funziona con chrome/safari no (forse si risolve pubblicando)
pagina index:
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="description" content="Sito dinamico con l'uso di JQuery.">
<title>Realizzare un sito dinamico con Jquery & Ajax.</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
</head>
<body>
<script src="jquery-latest.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#contentArea").load("quasi.html");
});
</script>
<div id="contentArea"> </div>
</body>
</html>
pagina quasi:
codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Validare una forrm con AJAX/jQuery</title>
<script type="text/javascript" src="quasijs.js"></script>
<style type="text/css">
#wrapper {
margin: 10px;
}
#contact-form label {
font-size: 18px;
color: #6e6e6e;
}
input#name, input#mail, input#subject, textarea#message {
padding: 2px;
width: 250px;
}
input#name:focus, input#mail:focus, input#subject:focus, textarea#message:focus {
border: 2px #999 solid;
}
textarea#message {
height: 100px;
}
.error, .success {
padding-left: 24px;
padding-top: 7px;
padding-bottom: 5px;
padding-right: 10px;
background-position: 4px 47%;
background-repeat: no-repeat;
font-weight: bold;
}
#validate-error {
background-color: #FFF4B5;
border: 1px solid #FF4500;
background-image: url(exclamation.png);
margin-left: 5px;
display: none;
}
.success {
background-color: #D0F0C0;
border: 1px solid #009E60;
background-image: url(accept.png);
width: 400px;
}
.field-error {
/*border: 2px #660000 solid !important;
background-color: #FCFFD5;*/
color: #af4c4c; margin: 0 0 6px 0; padding: 4px; background: #ffbfbf;
font-weight: bold;
}
</style>
<style type="text/css" media="screen">
/* Uni-Form style sheet */
@import "css/uni-form.css";
/* You don't need these, they are here to tune up the page */
.uniForm{ padding: 20px; background: #F2FAFF; -webkit-border-radius: 7px; }
.uniForm fieldset{ margin: 0 0 1.5em 0; }
.uniForm .inlineLabel em{ left: 10px !important; }
.uniForm .inlineLabels .ctrlHolder .multiField.phoneNum .blockLabel{ width: auto; }
.uniForm .inlineLabels .ctrlHolder .multiField .blockLabel #phone_ccode.textInput,
.uniForm .inlineLabels .ctrlHolder .multiField .blockLabel #phone_area.textInput{ width: 4em; }
</style>
<!--[if lte ie 7]>
<style type="text/css" media="screen">
/*
Move these to your IE6/7 specific stylesheet if possible
*/
.uniForm, .uniForm fieldset, .uniForm .ctrlHolder, .uniForm .formHint, .uniForm .buttonHolder, .uniForm .ctrlHolder .multiField, .uniForm .inlineLabel{ zoom:1; }
.uniForm .inlineLabels label, .uniForm .inlineLabels .label, .uniForm .blockLabels label, .uniForm .blockLabels .label, .uniForm .inlineLabel span{ padding-bottom: .2em; }
.uniForm .inlineLabel input, .uniForm .inlineLabels .inlineLabel input, .uniForm .blockLabels .inlineLabel input{ margin-top: -.3em; }
</style>
<![endif]-->
</head>
<body>
<form class="uniForm" method="post" action="sendmail.php" id="contact-form">
<fieldset class="inlineLabels">
<legend>Contact Details</legend>
<center><span id="validate-error" class="error"></span> </center>
<div class="ctrlHolder">
<p id="name-error" > </p>
<label>Nome</label>
<input name="name" type="text" id="name"/> </p>
<p class="formHint">
Your real name or your company's name.
</p>
</div>
<div class="ctrlHolder">
<p id="mail-error" ></p>
<label>Mail</label>
<input name="mail" type="text" id="mail" value=" s910101aaaaaaaaaa" />
</p>
<p class="formHint">
Will be used only to reply to you. Will not be passed on to a third party. Enter a valid email account.
</p>
</div>
<div class="ctrlHolder">
<label>Oggetto</label>
<input name="subject" type="text" id="subject" /></p>
</div>
<div class="ctrlHolder">
<p id="message-error" ></p>
<label>Messaggio</label>
<textarea name="message" id="message"></textarea></p>
</div>
<p align="center" ><input type="reset" name="indietro" value="indietro" style=" margin-right:50px"id="indietro" />
<input type="submit" name="submit" value="invia mail" id="submit" />
</p>
</fieldset>
</form>
<div id="server-output"></div>
</body>
</html>
in futuro, non usare i mp per aiuti privati a prescindere dalle disperazioni e bisogni.
Ciao.