Hope this is the correct category for an asp code question.
I have the following code
FOR i = 1 TO 20 : strCampo(i,0) = "" : strCampo(i,1) = "no" : NEXT
'strPrivacy = "no"
'strCampo(1,0) = "Username:" : strCampo(1,1) = "si"
'strCampo(2,0) = "Password:" : strCampo(2,1) = "si"
'strCampo(3,0) = "Conferma password:" : strCampo(3,1) = "si"
strCampo(4,0) = "Email:" : strCampo(4,1) = "si"
strCampo(5,0) = "Conferma email:" : strCampo(5,1) = "si"
strCampo(6,0) = "Nome e Cognome:" : strCampo(6,1) = "si"
'strCampo(7,0) = "Cognome:" : strCampo(7,1) = "si"
'strCampo(8,0) = "Ditta:" : strCampo(8,1) = "si"
'strCampo(9,0) = "Indirizzo1:" : strCampo(9,1) = "no"
'strCampo(10,0) = "Indirizzo2:" : strCampo(10,1) = "no"
'strCampo(11,0) = "CAP:" : strCampo(11,1) = "no"
'strCampo(12,0) = "Provincia:" : strCampo(12,1) = "no"
strCampo(13,0) = "CittĂ :" : strCampo(13,1) = "si"
'strCampo(14,0) = "Ambiente:" : strCampo(14,1) = "si"
'strCampo(15,0) = "Larghezza(metri):" : strCampo(15,1) = "si"
'strCampo(16,0) = "Lunghezza(metri):" : strCampo(16,1) = "si"
'strCampo(17,0) = "Telefono:" : strCampo(17,1) = "no"
'strCampo(18,0) = "Fax:" : strCampo(18,1) = "si"
'strCampo(19,0) = "Sito web:" : strCampo(19,1) = "si"
strCampo(20,0) = "Messaggio:" : strCampo(20,1) = "si"
FUNCTION IsGiust(strStringa, strPattern)
Dim objRegExp
Set objRegExp = New RegExp
objRegExp.Pattern = strPattern
objRegExp.IgnoreCase = True
IsGiust = objRegExp.Test(strStringa)
END FUNCTION
IF Request.QueryString("step") = 2 THEN
After that there are some controls (error checks) for the fields like this
FOR i = 1 to 20
IF strCampo(i,1) = "si" THEN
IF LEN(Request("T"&i)) < 1 THEN
strErrore(i) = "Campo obbligatorio"
strErrore(0) = "errore"
END IF
END IF
NEXT
'##### [T1] USER #####################################################
IF strCampo(1,0) <> "" AND LEN(Request("T1")) <> 0 THEN
IF LEN(Request("T1")) < 5 THEN
strErrore(1) = "Inserisci almeno 5 caratteri"
strErrore(0) = "errore"
END IF
END IF
then I have the following form
<form method="POST" action="<%=Request.ServerVariables ("URL")%>?step=2#Modulo">
<div class="text-center">
<p class="text-center">
(i campi con asterisco <span class="fz-required">*</span> sono obbligatori)
</p>
</div>
<!-- ######### bootstrap ######### -->
<div class="fz-form-box">
<% FOR i = 1 TO 19 %>
<% IF strCampo(i,0) <> "" THEN %>
<div class="form-group fz-name clearfix">
<label class="col-md-3" for="name"><%=strCampo(i,0)%> </label>
<div class="col-md-1 fz-required">
<% IF strCampo(i,1) = "si" THEN Response.Write ("<b>*</b>") %>
</div>
<div class="col-md-5">
<input name="T<%=i%>" tabindex="<%=i%>" value="<%=Request("T"&i)%>"
<% IF InStr( 1, strCampo(i,0), "password", 1) THEN %>
<%= " type='password'" %>
<% ELSE %>
<%= " type='text'" %>
<% END IF %>
<% IF strErrore(i) <> "" THEN %>
<%= " class='form-control has-error'" %>
<% ELSE %>
<%= " class='form-control'" %>
<% END IF %>
>
</div>
<div class="col-md-3 fz-required">
<%=strErrore(i)%>
</div>
</div>
<% END IF %>
<% NEXT %>
<% IF strCampo(20,0) <> "" THEN %>
<div class="form-group fz-name clearfix">
<label class="col-md-3" for="name"><%=strCampo(20,0)%>
</label>
<div class="col-md-1 fz-required">
<% IF strCampo(20,1) = "si" THEN Response.Write ("<b>*</b>") %>
</div>
<div class="col-md-5">
<textarea id="textarea" name="T20" tabindex="20"
<% IF strErrore(20) <> "" THEN %>
<%= " class='form-control has-error'" %>
<% ELSE %>
<%= " class='form-control'" %>
<% END IF %>
><%=Request("T20")%>
</textarea>
</div>
<div class="col-md-3 fz-required">
<%=strErrore(i)%>
</div>
</div>
<% END IF %>
<% IF strPrivacy = "no" THEN %>
<div class="text-center">
<input class="fz-button" type="submit" value="Invia" name="B1" id="invia">
</div>
<% ELSE %>
<div class="form-group fz-name clearfix">
<label class="col-md-2" for="name">Privacy:</label>
<div class="col-md-1">
<input class="form-control" type="checkbox" checked name="C1" value="ON" onclick="
if (document.getElementById('invia').disabled == true)
{document.getElementById('invia').disabled = false}
else {document.getElementById('invia').disabled = true}
">
</div>
<div class="col-md-9">
Acconsento al trattamento dei dati personali ai sensi e per gli effetti del D. Lgs. 196/2003
</div>
</div>
<div class="form-group clearfix">
<input class="fz-button" type="submit" value="Invia" name="B1" id="invia">
</div>
<% END IF %>
</div>
</form>
The above works ok, only problem is it outputs the privacy checkbox already checked.
I’d like to have it unchecked, and make it required for the user to check before submitting.
Thank you.