Ver Mensaje Individual
  #18 (permalink)  
Antiguo 16/01/2008, 09:19
rumbo
 
Fecha de Ingreso: enero-2008
Mensajes: 5
Antigüedad: 16 años, 3 meses
Puntos: 0
Re: formulario enviar a un amigo

En principio, el formulario sería así:
Cita:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Resultados por e-mail</title>
</head>

<body>

<!-- *** begin e-mail routing table *** -->
<SCRIPT language=javascript>
function checkemail(email) {
var re = /^[a-z0-9][-+a-z0-9_\.\\']*@[-a-z0-9]+(\.[-a-z0-9]*)+$/i;
return re.test(email);
}

function gradeformvalidate () {
if(document.graderform.student_name.value.length == 0) {
alert('Por favor, introduce o teu nome:');
return false;
}

var student_email = document.graderform.student_email.value;
var teacher_email = document.graderform.teacher_email.value;
var ta_email = document.graderform.ta_email.value;
var other_email = document.graderform.other_email.value;

student_email = student_email.replace(/\s+/g, '');
teacher_email = teacher_email.replace(/\s+/g, '');
ta_email = ta_email.replace(/\s+/g, '');
other_email = other_email.replace(/\s+/g, '');

var num_emails = 0;
var errMsg = '';
if(document.graderform.mail_student.checked)
{
++num_emails;
if(student_email == '' || !checkemail(student_email))
errMsg = 'A tua direccion de correo non é valida.';
}
if(document.graderform.mail_teacher.checked)
{
++num_emails;
if(teacher_email == '' || !checkemail(teacher_email))
{
if(errMsg != '')
errMsg += '\n';
errMsg += 'O correo do teu ensinante non é valida.';
}
}
if(document.graderform.mail_other.checked)
{
++num_emails;
if(other_email == '' || !checkemail(other_email))
{
if(errMsg != '')
errMsg += '\n';
errMsg += 'Esta dirección de correo non é válida.';
}
}
if(num_emails == 0)
errMsg = 'Por favor, seleccione i encha a lo menos unha dirección de correo';

if(errMsg != '') {
window.alert(errMsg);
return false;
}

document.graderform.submit();
return true;
}
</SCRIPT>

<table cellSpacing="0" cellPadding="0" align="center" bgColor="#666666" summary="A display table presents a form that can be used to email these results to up to four different email addresses." border="0" id="table21">
<tr>
<form name="graderform" method="post" action="http:???????????">
<input type="hidden" value="email-basic" name="command">
<input type="hidden" value="v90jNwoDwaUAAC@@2KsAAABe" name="session">
<input type="hidden" value="/esm_organic_wade_5" name="url_path">
<input type="hidden" value="348633" name="id">
<input type="hidden" name="teacher_name">
<input type="hidden" name="ta_name">
<input type="hidden" name="other_name">
<td><!--- leave cell open --->
<table cellSpacing="1" cellPadding="6" width="100%" align="center" summary="A display table announces the beginning of the email form and contains it." border="0" id="table22">
<tr>
<td class="tableRowTitle" align="middle" colSpan="3">
<span class="contentSubHeader">A tua resposta por correo</span></td>
</tr>
<tr>
<td class="tableRowHead" noWrap>
<p class="EmailForm"><label for="myname">O teu nome:</label></td>
<td class="tableRowHead" colSpan="2">
<input id="myname" maxLength="100" size="40" name="student_name">
</td>
</tr>
<tr>
<td class="tableRowWhite" colSpan="3">
<p class="EmailForm">¿qué correos electrónicos dexexas enviar?</td>
</tr>
<tr class="tableRowHead">
<td>
<img height="1" alt="Esta sección permite enviar correo electrónico cas tuas respostas as contas de correo: tua, o teu ensinante, u outras. enche os datos que desexes." hspace="0" src="dot.gif" width="1" border="0"></td>
<td>
<p class="tableRowHead">Dirección E-mail: </td>
<td>
<p class="tableRowHead">Enviado como:</td>
</tr>
<tr>
<td class="tableRowAlt1">
<p class="EmailForm"><label for="me">
<img height="1" alt="Me:" hspace="0" src="dot.gif" width="1" border="0"></label><br>
<input id="me" type="checkbox" value="1" name="mail_student">
O teu correo:</td>
<td class="tableRowAlt1"><label for="myemail">
<img height="1" alt="My email address is:" hspace="0" src="dot.gif" width="1" border="0"></label><br>
<input id="myemail" maxLength="50" name="student_email">
</td>
<td class="tableRowAlt1"><label for="metype">
<img height="1" alt="Send email to me as:" hspace="0" src="dot.gif" width="1" border="0"></label><br>
<select id="metype" name="student_type">
<option value="plain:no" selected>Texto</option>
<option value="html:no">HTML</option>
<option value="plain:yes">Texto adxunto</option>
<option value="html:yes">HTML adxunto</option>
</select> </td>
</tr>
<tr>
<td class="tableRowAlt1" noWrap>
<p class="EmailForm"><label for="instructor">
<img height="1" alt="Instructor:" hspace="0" src="dot.gif" width="1" border="0"></label><br>
<input id="instructor" type="checkbox" value="1" name="mail_teacher">
O teu profesor:</td>
<td class="tableRowAlt1"><label for="instremail">
<img height="1" alt="My instructor's email address is:" hspace="0" src="dot.gif" width="1" border="0"></label><br>
<input id="instremail" maxLength="50" name="teacher_email">
</td>
<td class="tableRowAlt1"><label for="teachertype">
<img height="1" alt="Send email to my Instructor as:" hspace="0" src="dot.gif" width="1" border="0"></label><br>
<select id="teachertype" name="teacher_type">
<option value="plain:no" selected>Texto</option>
<option value="html:no">HTML</option>
<option value="plain:yes">Texto adxunto</option>
<option value="html:yes">HTML adxunto</option>
</select> </td>
</tr>

<tr>
<td class="tableRowAlt1">
<p class="EmailForm"><label for="other">
<img height="1" alt="Other:" hspace="0" src="dot.gif" width="1" border="0"></label><br>
<input id="other" type="checkbox" value="1" name="mail_other">
Outro:</td>
<td class="tableRowAlt1"><label for="oemail">
<img height="1" alt="The other email address is:" hspace="0" src="dot.gif" width="1" border="0"></label><br>
<input id="oemail" maxLength="50" name="other_email"> </td>
<td class="tableRowAlt1"><label for="otype">
<img height="1" alt="Send email to this address as:" hspace="0" src="dot.gif" width="1" border="0"></label><br>
<select id="otype" name="other_type">
<option value="plain:no" selected>Texto</option>
<option value="html:no">HTML</option>
<option value="plain:yes">Texto adxunto</option>
<option value="html:yes">HTML adxunto</option>
</select> </td>
</tr>
<tr>
<td class="tableRowAlt1" colSpan="2">
<p class="EmailForm">
<td class="tableRowAlt1" align="right">
<input onclick="gradeformvalidate();" type="button" value="Envia correos" name="register"></td>
</tr>
</table>
</td>
<!--- close open cell --->
</form>
</tr>
</table>
<!-- *** end e-mail routing table *** -->
</body>

</html>