salve a tutti.
ho fatto questo semplice form con quark xpress:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content=text/html;CHARSET=windows-1252>
<SCRIPT language=JavaScript>
<!--
var whitespace = " \t\n\r";
var errorFieldStr = "";
function ValidateFinestradelmodulo1(form) {
if (ValidateField(form.elements["Testo4"]) &
ValidateField(form.elements["Testo3"]) &
ValidateField(form.elements["Testo2"]) &
ValidateField(form.elements["Testo1"]))
return true;
else DisplayErrorDialog("Il campo obbligatorio " + errorFieldStr + " risulta mancante.");
}
function DisplayErrorDialog(errorStr) {
alert(errorStr);
errorFieldStr = "";
return false;
}
function AddErrorField(theField) {
if (errorFieldStr == "")
errorFieldStr = theField.name;
else errorFieldStr = errorFieldStr + ", " + theField.name;
return false;
}
function ValidateField(theField) {
if (IsBlank(theField.value))
return AddErrorField(theField);
else return true;
}
function IsBlank(fieldValue) {
var i;
if ((fieldValue == null) || (fieldValue.length == 0)) return true;
for (i = 0; i < fieldValue.length; i++)
{
var c = fieldValue.charAt(i);
if (whitespace.indexOf(c) == -1) return false;
}
return true;
}
//-->
</SCRIPT>
<STYLE type=text/css>A:link {
COLOR: blue; TEXT-DECORATION: underline
}
A:active {
COLOR: red
}
A:visited {
COLOR: purple
}
BODY {
COLOR: black; BACKGROUND-COLOR: white
}
.box1 {
}
</STYLE>
<META content="MSHTML 6.00.2800.1505" name=GENERATOR></HEAD>
<BODY leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<TABLE cellSpacing=0 cellPadding=0 align=left border=0>
<TBODY>
<TR>
<TD colSpan=2></TD>
<TD vAlign=top width=1 height=199>[img]Esporta1_file/qwdspacer.gif[/img]</TD></TR>
<TR>
<TD></TD>
<TD vAlign=top width=300 height=500>
<DIV class=box1>
<FORM name=Finestradelmodulo1
onsubmit="if (ValidateFinestradelmodulo1(Finestradelmodulo1)) return true; else return false;"
action="" method=post>
<TABLE height=500 cellSpacing=0 cellPadding=0 width=300 align=left
border=0>
<TBODY>
<TR>
<TD width=170 colSpan=4 height=20>
<DIV class=box1><INPUT size=27 name=Testo1></DIV></TD>
<TD colSpan=2></TD>
<TD vAlign=top width=84 height=20>[img]Esporta1_file/qwdspacer.gif[/img]</TD></TR>
<TR>
<TD colSpan=6></TD>
<TD vAlign=top width=84 height=57>[img]Esporta1_file/qwdspacer.gif[/img]</TD></TR>
<TR>
<TD width=170 colSpan=4 height=20>
<DIV class=box1><INPUT size=27 name=Testo2></DIV></TD>
<TD colSpan=2></TD>
<TD vAlign=top width=84 height=20>[img]Esporta1_file/qwdspacer.gif[/img]</TD></TR>
<TR>
<TD colSpan=6></TD>
<TD vAlign=top width=84 height=58>[img]Esporta1_file/qwdspacer.gif[/img]</TD></TR>
<TR>
<TD width=170 colSpan=4 height=20>
<DIV class=box1><INPUT size=27 name=Testo3></DIV></TD>
<TD colSpan=2></TD>
<TD vAlign=top width=84 height=20>[img]Esporta1_file/qwdspacer.gif[/img]</TD></TR>
<TR>
<TD colSpan=6></TD>
<TD vAlign=top width=84 height=51>[img]Esporta1_file/qwdspacer.gif[/img]</TD></TR>
<TR>
<TD width=166 colSpan=3 height=20>
<DIV class=box1><INPUT size=27 name=Testo4></DIV></TD>
<TD colSpan=3></TD>
<TD vAlign=top width=84 height=20>[img]Esporta1_file/qwdspacer.gif[/img]</TD></TR>
<TR>
<TD colSpan=6></TD>
<TD vAlign=top width=84 height=64>[img]Esporta1_file/qwdspacer.gif[/img]</TD></TR>
<TR>
<TD colSpan=5></TD>
<TD width=43 height=20 rowSpan=2>
<DIV
class=box1><INPUT type=submit value=invia name=Pulsante2></DIV></TD>
<TD vAlign=top width=84 height=5>[img]Esporta1_file/qwdspacer.gif[/img]</TD></TR>
<TR>
<TD></TD>
<TD width=80 height=20 rowSpan=2>
<DIV
class=box1><INPUT type=reset value=Cancella name=Pulsante1></DIV></TD>
<TD colSpan=3></TD>
<TD vAlign=top width=84 height=15>[img]Esporta1_file/qwdspacer.gif[/img]</TD></TR>
<TR>
<TD></TD>
<TD colSpan=4></TD>
<TD vAlign=top width=84 height=5>[img]Esporta1_file/qwdspacer.gif[/img]</TD></TR>
<TR>
<TD vAlign=top width=23 height=165>[img]Esporta1_file/qwdspacer.gif[/img]</TD>
<TD vAlign=top width=80 height=165>[img]Esporta1_file/qwdspacer.gif[/img]</TD>
<TD vAlign=top width=63 height=165>[img]Esporta1_file/qwdspacer.gif[/img]</TD>
<TD vAlign=top width=4 height=165>[img]Esporta1_file/qwdspacer.gif[/img]</TD>
<TD vAlign=top width=3 height=165>[img]Esporta1_file/qwdspacer.gif[/img]</TD>
<TD vAlign=top width=43 height=165>[img]Esporta1_file/qwdspacer.gif[/img]</TD>
<TD vAlign=top width=84 height=165>[img]Esporta1_file/qwdspacer.gif[/img]</TD></TR></TBODY></TABLE></FORM></DIV></TD>
<TD vAlign=top width=1 height=500>[img]Esporta1_file/qwdspacer.gif[/img]</TD></TR>
<TR>
<TD vAlign=top width=226 height=1>[img]Esporta1_file/qwdspacer.gif[/img]</TD>
<TD vAlign=top width=300 height=1>[img]Esporta1_file/qwdspacer.gif[/img]</TD>
<TD vAlign=top width=1 height=1>[img]Esporta1_file/qwdspacer.gif[/img]</TD></TR></TBODY></TABLE></BODY></HTML>
vi spiego il problema.
io voglio fare questo.
il testo3 e il testo4 devono essere in ogni caso obbligatori, e il testo1 e testo2 no.
ma se scrivo sul testo1 deve diventare obbligatorio anche il testo2 e viceversa(ovviamente il 3 e il 4 restano sempre obbligatori)
sono 2 giorni che ci sbatto la testa e che faccio funzioni, che però nn danno molti risultati.
sperando di nn aver sbagliato sezione , spero che qualcuno mi dia 1 mano.
grazie.