<?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 select e refresh]]></title><description><![CDATA[<p dir="auto">Salve, ho un form che prevede l'inserimento di diversi dati. Ad un certo punto c'è anche una select che prevede il refresh della pagina ogni volta che viene selezionata una voce.<br />
Questo è il codice</p>
<pre><code class="language-php">&lt;select name="giorno_app&lt;?php echo $cont?&gt;" id="giorno_app&lt;?php echo $cont?&gt;" class="giornofac" onchange="document.forms[0].submit()"&gt;
                        &lt;option&gt;&lt;/option&gt;
                        &lt;option value="venerdì" &lt;?php if ($giorno_app[$cont] == "venerdì") echo "selected" ?&gt;&gt;venerdì&lt;/option&gt;
                        &lt;option value="sabato" &lt;?php if ($giorno_app[$cont] == "sabato") echo "selected" ?&gt;&gt;sabato&lt;/option&gt;
                        &lt;option value="domenica" &lt;?php if ($giorno_app[$cont] == "domenica") echo "selected" ?&gt;&gt;domenica&lt;/option&gt;
              &lt;/select&gt;
</code></pre>
<p dir="auto">Quello che mi occorre è che quando faccio il refresh della pagina il cursore deve posizionarsi all'altezza della select.<br />
Ho provato a mettere un ancora però non so come fare ad agganciarla con il refresh.</p>
<p dir="auto">Qualcuno sa darmi qualche indicazione?</p>
]]></description><link>https://dev.connect.gt/topic/162160/problema-con-select-e-refresh</link><generator>RSS for Node</generator><lastBuildDate>Sat, 28 Nov 2026 22:20:49 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/162160.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Dec 2011 15:33:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problema con select e refresh on Wed, 14 Dec 2011 09:27:04 GMT]]></title><description><![CDATA[<p dir="auto">Questo è il mio metodo:</p>
<p dir="auto">apertura della form</p>
<pre><code class="language-php">&lt;form name="dati" action="#" method="post"&gt;
</code></pre>
<p dir="auto">la select</p>
<pre><code class="language-php">&lt;select tabindex="3" name="tipo"&gt;
&lt;?php
				require_once 'config.inc.php';
				$db = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) or
				die ('Unable to connect. Check your connection parameters.');
				mysql_select_db(MYSQL_DB, $db) or die(mysql_error($db));
   				$domanda="SELECT tipo FROM macchine_tipologie ORDER BY tipo";
				$risposta=mysql_query($domanda, $db) or die (mysql_error($db));
   				while ($row=mysql_fetch_array($risposta)){
   					if ($row['tipo']==$_POST['tipo']) $sel='selected="selected"'; else $sel='';
   					print ("&lt;option ".$sel." value=\"".$row['tipo']."\"&gt;".$row['tipo']."&lt;/option&gt;");
  			 	}//end while 
   		echo ('&lt;/select&gt;');
</code></pre>
<p dir="auto">tralasciando il fatto che io popolo la select tramite dei valori salvati in un DB, il tutto a me funziona benissimo.</p>
<p dir="auto">Quello che non vedo nella tua parte di codice è come definisci la variabile $giorno_app[$cont] : se non è uguale a niente, allora non può essere né venerdì, né sabato e così via.</p>
]]></description><link>https://dev.connect.gt/post/1040093</link><guid isPermaLink="true">https://dev.connect.gt/post/1040093</guid><dc:creator><![CDATA[cyrus]]></dc:creator><pubDate>Wed, 14 Dec 2011 09:27:04 GMT</pubDate></item><item><title><![CDATA[Reply to Problema con select e refresh on Tue, 13 Dec 2011 15:21:04 GMT]]></title><description><![CDATA[<p dir="auto">Non cambia nulla.<br />
Il problema sta nel form e nella possibilità, dopo il refresh, di posizionarsi su un ancora.<br />
Il form inizia così</p>
<pre><code class="language-html">&lt;form method="post" action="#"&gt;
</code></pre>
<p dir="auto">Se io riuscissi ad agganciare l'ancora all'action='#' avrei risolto il problema</p>
]]></description><link>https://dev.connect.gt/post/1040097</link><guid isPermaLink="true">https://dev.connect.gt/post/1040097</guid><dc:creator><![CDATA[freebreathe]]></dc:creator><pubDate>Tue, 13 Dec 2011 15:21:04 GMT</pubDate></item><item><title><![CDATA[Reply to Problema con select e refresh on Tue, 13 Dec 2011 13:35:47 GMT]]></title><description><![CDATA[<p dir="auto">Ciao, non son sicuro che sia la soluzione giusta, ma mi sa che il problema potrebbe essere in questa riga</p>
<pre><code class="language-php">&lt;select name="giorno_app&lt;?php echo $cont?&gt;" id="giorno_app&lt;?php echo $cont?&gt;" class="giornofac" onchange="document.forms[0].submit()"&gt;
</code></pre>
<p dir="auto">prova con</p>
<pre><code class="language-php">&lt;select name="giorno_app[&lt;?php echo $cont?&gt;]" id="giorno_app[&lt;?php echo $cont?&gt;]" class="giornofac" onchange="document.forms[0].submit()"&gt;
</code></pre>
<p dir="auto">se non funziona prova comunque a stamparti tutto $_POST per vedere cosa ti stai stai passando come variabili.<br />
A proposito a $giorno_app[$cont] gli passi il valore che ti passi col form tramite $_POST?</p>
]]></description><link>https://dev.connect.gt/post/1040092</link><guid isPermaLink="true">https://dev.connect.gt/post/1040092</guid><dc:creator><![CDATA[cyrus]]></dc:creator><pubDate>Tue, 13 Dec 2011 13:35:47 GMT</pubDate></item><item><title><![CDATA[Reply to Problema con select e refresh on Mon, 05 Dec 2011 09:52:35 GMT]]></title><description><![CDATA[<p dir="auto">E' nella select che ho postato sopra.<br />
Cmq lo fa con questo codice</p>
<p dir="auto">onchange="document.forms[0].submit()"</p>
]]></description><link>https://dev.connect.gt/post/1040098</link><guid isPermaLink="true">https://dev.connect.gt/post/1040098</guid><dc:creator><![CDATA[freebreathe]]></dc:creator><pubDate>Mon, 05 Dec 2011 09:52:35 GMT</pubDate></item><item><title><![CDATA[Reply to Problema con select e refresh on Mon, 05 Dec 2011 09:50:35 GMT]]></title><description><![CDATA[<p dir="auto">Il reflesh come avviene? A livello di codice intendo come lo hai impostato.</p>
]]></description><link>https://dev.connect.gt/post/1040087</link><guid isPermaLink="true">https://dev.connect.gt/post/1040087</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Mon, 05 Dec 2011 09:50:35 GMT</pubDate></item><item><title><![CDATA[Reply to Problema con select e refresh on Mon, 05 Dec 2011 09:49:32 GMT]]></title><description><![CDATA[<p dir="auto">Ciao, grazie della risposta.<br />
Ma qui l'url non esiste perché la pagina fa il refresh e solo allora deve posizionarsi all'altezza dell'ancora.<br />
Come posso fare?</p>
]]></description><link>https://dev.connect.gt/post/1040096</link><guid isPermaLink="true">https://dev.connect.gt/post/1040096</guid><dc:creator><![CDATA[freebreathe]]></dc:creator><pubDate>Mon, 05 Dec 2011 09:49:32 GMT</pubDate></item><item><title><![CDATA[Reply to Problema con select e refresh on Fri, 02 Dec 2011 18:36:13 GMT]]></title><description><![CDATA[<p dir="auto">Ciao freebreathe,<br />
devi aggiungere alla fine dell'url <a href="/hashtags/nomeancoraggio">#nome_ancoraggio</a> per mandarlo su quel punto.</p>
]]></description><link>https://dev.connect.gt/post/1040086</link><guid isPermaLink="true">https://dev.connect.gt/post/1040086</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Fri, 02 Dec 2011 18:36:13 GMT</pubDate></item></channel></rss>