Ciao Ragazzi, scusate, vorrei un piccolo aiuto: Ho un form con alcuni campi obbligatori, come faccio a togliere i campi obbligatori? Vorrei che ogni campo non fosse obbligatorio (ecco il codice della pagina):
<% Response.Buffer = "True" %>
<% Response.CacheControl = "Private" %>
<% Response.Expires = -1 %>
<%Dim rs, conn, sql, sel
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
conn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial " _
&"Catalog=T_TABELLE;Data Source=srv-db00;Use Procedure for Prepare=1;Auto " _
&"Translate=True;Packet Size=4096;Workstation ID=srv-db00;"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Curriculum Online Anagrafica</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="author" content="Concept: - Contrappunto - ">
<meta name="author" content="Implementation: VirtualAct - [www.virtualact.it]">
<link href="img/style.css" rel="stylesheet" type="text/css">
<style>BODY {
scrollbar-face-color: FFFFFF;
scrollbar-shadow-color: #003466;
scrollbar-highlight-color: ff6600;
scrollbar-3dlight-color: ffffff;
scrollbar-darkshadow-color: #003466;
scrollbar-track-color: #FFFFFF;
scrollbar-arrow-color: #003466;
}</style>
<script language="JavaScript">
<!--
//Funzione per inviare la form premendo il tasto di invio
function EnterK(e){
if ((document.all&&event.keyCode==13) || (document.layers&&e.which==13))
InviaForm();
}
document.onkeypress=EnterK;
//Funzioni per il passaggio automatico da una casella alla successiva
function Sposta1()
{
if (document.curr1.GIORNO.value.length == 2)
document.curr1.MESE.focus();
}
function Sposta2()
{
if (document.curr1.MESE.value.length == 2)
document.curr1.ANNO.focus();
}
function Sposta3()
{
if (document.curr1.ANNO.value.length == 4)
document.curr1.NATO_A.focus();
}
function Sposta4()
{
document.curr1.STATO0.focus();
}
function Sposta5()
{
document.curr1.SESSO.focus();
}
function Sposta6()
{
document.curr1.INDIRIZZO0.focus();
}
function Sposta7()
{
document.curr1.TELEFONO0.focus();
}
//Funzione per invio della form
function InviaForm() {
if (document.curr1.NOME.value== "") {
alert("Inserire il Nome");
document.curr1.NOME.focus();
return;
}
if (document.curr1.COGNOME.value== "") {
alert("Inserire il Cognome");
document.curr1.COGNOME.focus();
return;
}
if (document.curr1.TELEFONO0.value== "") {
alert("Inserire il Telefono");
document.curr1.TELEFONO0.focus();
return;
}
if (document.curr1.MAIL.value== "") {
alert("Inserire l'E-Mail");
document.curr1.MAIL.focus();
return;
}
if (document.curr1.GIORNO.value== "") {
alert("Inserire il giorno di nascita");
document.curr1.GIORNO.focus();
return;
}
if (document.curr1.MESE.value== "") {
alert("Inserire il mese di nascita");
document.curr1.MESE.focus();
return;
}
if (document.curr1.ANNO.value== "") {
alert("Inserire l'anno di nascita");
document.curr1.ANNO.focus();
return;
}
if (document.curr1.PROV_NASCITA.value== "") {
alert("Inserire la provincia di nascita");
document.curr1.PROV_NASCITA.focus();
return;
}
if (document.curr1.NATO_A.value== "") {
alert("Inserire la città di nascita");
document.curr1.NATO_A.focus();
return;
}
if (document.curr1.SESSO.value== "") {
alert("Inserire il genere");
document.curr1.SESSO.focus();
return;
}
giorno=document.curr1.GIORNO.value;
mese=document.curr1.MESE.value;
anno=document.curr1.ANNO.value;
data=giorno + "/" + mese + "/" + anno;
document.curr1.NATO_IL.value=data;
document.curr1.submit();
}
//Funzione per il controllo della mail
function verMail(dati) {
if (document.curr1.MAIL.value != "") {
if ((document.curr1.MAIL.value.indexOf("@") == -1) || (document.curr1.MAIL.value.indexOf(".") == -1) || (document.curr1.MAIL.value.length < 7)) {
alert("E-mail non valida");
document.curr1.MAIL.focus();
}
}
}
//Funzione per il controllo del telefono
function verTel(field) {
var valid = "0123456789"
var ok = "0";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "1";
}
if (ok == "1") {
alert("Numero di telefono non valido.");
field.select();
return;
}
}
function startJump(){
var codQry = "curriculum_online_anag02.asp?USERNAME=XX&PASSWORD =XX&POSLAV=&azione=1&PROV_NASCITA="+document.curr1 .PROV_NASCITA[document.curr1.PROV_NASCITA.selectedIndex].value
document.curr1.action=codQry;
document.curr1.submit();
}
//-->
</SCRIPT>