<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Problema con if instr]]></title><description><![CDATA[<p dir="auto">Ciao ragazzi,<br />
Ho un problema che mi sta facendo venire matto<br />
in poche parole ho un form nella pagina modulo.asp così</p>
<pre><code>&lt;form action="update.asp" method="POST" name="form" &gt;
giorno&lt;input name="orario" type="checkbox" value="Giorno" /&gt;
sera&lt;input name="orario" type="checkbox" value="Sera" /&gt;
notte&lt;input name="orario" type="checkbox" value="Notte" /&gt;


Lunedi &lt;input name="check" type="checkbox" value="Lunedi" /&gt;
Martedi&lt;input name="check" type="checkbox" value="Martedi" /&gt;
Mercoledi&lt;input name="check" type="checkbox" value="Mercoledi" /&gt;
Giovedi&lt;input name="check" type="checkbox" value="Giovedi" /&gt;
Venerdi&lt;input name="check" type="checkbox" value="Venerdi" /&gt;
Sabato&lt;input name="check" type="checkbox" value="Sabato" /&gt;
Domenica&lt;input name="check" type="checkbox" value="Domenica" /&gt;
          &lt;input type="text" name="annuncio" size="32" /&gt;
          &lt;input type="text" name="annunciov" size="32" /&gt;
&lt;input type="submit" value="Aggiorna record" /&gt;
&lt;/form&gt;
</code></pre>
<p dir="auto">questo form spedisce i vari valori alla pagina Update.asp<br />
Nela pagina update ho fatto la regola per le checkbox check che recita in italiano piu o meno così:<br />
Se l'input check  ha il valore lunedi maggiore di 1 allora rispondi così:<br />
Ma forse è meglio che vi dica il codice</p>
<pre><code>&lt;%dim check
check=request.form("check")

IF INSTR(check,"Lunedi" )&gt;0 then
-hai selezionato lunedi
end if
IF INSTR(check,"Martedi" )&gt;0 then
-e anche martedi 
end if
</code></pre>
<p dir="auto">Adesso il mio problema è che dovrei modificare la condizione per le checkbox considerando due valori ,tipo:<br />
se la checkbox check ha  il valore uguale a lunedi<br />
e le checkbox orario ha   il valore uguale a giorno<br />
allora stampa questo<br />
Una cosa importante e che se ho spuntato piu cose mi deve riportare il risultato di <strong>tutte le possibilità</strong>  come nel codice sopra della pagina update<br />
Io col mio cervelletto ho provato varie sintassi ma non mi hanno portato niente di quello che speravo<br />
vi riporto anche le varie prove <strong>non funzionanti</strong></p>
<p dir="auto">prova uno:</p>
<pre><code>dim ora
ora=request.form("orario")

IF INSTR(check,"Lunedi" )&gt;0 and instr(ora,"giorno")&gt;0 then
-hai selezionato lunedi-giorno
end if
IF INSTR(check,"Lunedi" )&gt;0 and instr(ora,"sera")&gt;0 then
 -hai selezionato lunedi-sera
 end if
IF INSTR(check,"Lunedi" )&gt;0 and instr(ora,"notte")&gt;0 then
  -hai selezionato lunedi-notte
  end if

IF INSTR(check,"Martedi" )&gt;0  and instr(ora,"giorno")&gt;0 then
-e anche martedi -giorno
end if
IF INSTR(check,"Martedi" )&gt;0  and instr(ora,"sera")&gt;0 then
 -e anche martedi -sera
 end if

ecc. eccetera
</code></pre>
<p dir="auto">Prova Due:</p>
<pre><code>IF INSTR(check,"Lunedi" )&gt;0 then
    if instr(ora,"giorno")&gt;0 then
            -hai selezionato lunedi-giorno
    end if
 end if
IF INSTR(check,"Lunedi" )&gt;0 then
    if instr(ora,"sera")&gt;0 then
            -hai selezionato lunedi-sera
      end if
end if
IF INSTR(check,"Lunedi" )&gt;0 then
    if instr(ora,"notte")&gt;0 then
             -hai selezionato lunedi-notte
    end if
end if
</code></pre>
<p dir="auto">Qualche suggerimento</p>
]]></description><link>https://dev.connect.gt/topic/117814/problema-con-if-instr</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 04:59:45 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/117814.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 22 Dec 2009 13:33:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problema con if instr on Tue, 22 Dec 2009 16:02:51 GMT]]></title><description><![CDATA[<p dir="auto">Risposta !<br />
Il codice di prova due è corretto e funziona avevo sbagliato i nomi dei valori  che ho messo senza maiuscole</p>
]]></description><link>https://dev.connect.gt/post/880500</link><guid isPermaLink="true">https://dev.connect.gt/post/880500</guid><dc:creator><![CDATA[alcatraz75]]></dc:creator><pubDate>Tue, 22 Dec 2009 16:02:51 GMT</pubDate></item></channel></rss>