<?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[[javascript] Aiuto form]]></title><description><![CDATA[<p dir="auto">Ragazzi,<br />
ho bisogno di creare una form, e tramite javascript voglio che al cambiare del radio button che ho spuntato cambi l'indirizzo di OK.</p>
<p dir="auto">Ecco di seguito il codice:</p>
<pre><code>&lt;script type="text/javascript"&gt;
&lt;!--
function okURL (theForm){
    if (theForm.$$video1$$[0].checked) 
    
    theForm.okURL.value = "cisco.com/web/IT/events/video_datasheet/video_uc500.html";
    

if (theForm.$$video1$$[1].checked) 
    
    theForm.okURL.value = "//cisco.com/web/IT/events/video_datasheet/video_asa5500.html";
    }


function Controllo(theForm) {

    alert (document.form1.okURL.value)

                if (theForm.$$nome$$.value == "") {

                               alert ("Per favore, introduci il campo NOME.");

                               theForm.$$nome$$.focus();

                               return (false);

                }
                
                if (theForm.$$cognome$$.value == "") {

                               alert ("Per favore, introduci il campo COGNOME.");

                               theForm.$$cognome$$.focus();

                               return (false);

                }
                
                if (theForm.$$ragione_sociale$$.value == "") {

                               alert ("Per favore, introduci il campo RAGIONE SOCIALE.");

                               theForm.$$ragione_sociale$$.focus();

                               return (false);

                }

                                
                if (theForm.$$citta$$.value == "") {

                               alert ("Per favore, introduci il campo CITTA'.");

                               theForm.$$citta$$.focus();

                               return (false);

                }
                
                        
                if (theForm.$$provincia$$.value == "") {

                               alert ("Per favore, introduci il campo PROVINCIA'.");

                               theForm.$$provincia$$.focus();

                               return (false);

                }
                
                
                if (theForm.$$indirizzo$$.value == "") {

                               alert ("Per favore, introduci il campo INDIRIZZO'.");

                               theForm.$$indirizzo$$.focus();

                               return (false);

                }
                
                
                if (theForm.$$to$$.value == "") {

                               alert ("Per favore, introduci il campo E-MAIL.");

                               theForm.$$to$$.focus();

                               return (false);

                }
                
              theForm.to.value=theForm.$$to$$.value;
                
                if (theForm.$$telefono$$.value == "") {

                               alert ("Per favore, introduci il campo TELEFONO'.");

                               theForm.$$telefono$$.focus();

                               return (false);

                }

}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i&lt;a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&amp;&amp;i&lt;a.length&amp;&amp;(x=a[i])&amp;&amp;x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))&gt;0&amp;&amp;parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&amp;&amp;d.all) x=d.all[n]; for (i=0;!x&amp;&amp;i&lt;d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&amp;&amp;d.layers&amp;&amp;i&lt;d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x &amp;&amp; d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i&lt;(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//--&gt;
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
                           &lt;form name="form1" onsubmit="return Controllo(this)" method="post" action="scip. retesesa.it:81/deliverMail.asp" &gt;
                            

                              &lt;input name="from" type="hidden" id="from" value="info@computervar.it" /&gt;
                              &lt;input name="bcc" type="hidden" id="bcc" value="g.antichi@computervar.it" /&gt;
                              &lt;input name="subject" type="hidden" id="subject" value="Iscrizione Computer Var-Cisco (Video Datasheet)" /&gt;
                              &lt;input name="contentType" type="hidden" id="contentType" value="html" /&gt;
                              &lt;input name="bodyForm" type="hidden" id="bodyForm" value="cvar/conferma_cisco-datasheet.htm" /&gt;
                              &lt;input name="okURL" type="hidden" id="okURL" value=" cisco.com/web/IT/events/video_datasheet/video_uc500.html" /&gt;
                              &lt;input name="koURL" type="hidden" id="koURL" value=" computervar.it/webinar_cisco/form_cisco_datasheet.htm" /&gt;
                            
                                    &lt;p&gt;nome&lt;/p&gt;&lt;input type="text" name="$$nome$$" size="20" /&gt;
                                

                                    &lt;p&gt;cognome&lt;/p&gt;&lt;input name="$$cognome$$" type="text" id="$$cognome$$" size="20" /&gt;
                               
                                    &lt;p&gt;rag. sociale&lt;/p&gt;&lt;input name="$$ragione_sociale$$" type="text" id="$$ragione_sociale$$" size="20" /&gt;
                            
                                  &lt;p&gt;indirizzo&lt;/p&gt;&lt;input name="$$indirizzo$$" type="text" id="$$indirizzo$$" size="20" /&gt;

                                  &lt;p&gt;città&lt;/p&gt;
                                  &lt;input name="$$citta$$" type="text" id="$$citta$$" size="20" /&gt;
                                  
                                  &lt;p&gt;provincia&lt;/p&gt;&lt;input name="$$provincia$$" type="text" id="$$provincia$$" size="10" /&gt;
                                 
                                  &lt;p&gt;cap&lt;/p&gt;&lt;input name="$$cap$$" type="text" id="$$cap$$" size="12" /&gt;
                               
                                  &lt;p&gt;email&lt;/p&gt;&lt;input name="$$to$$" id="$$to$$" type="text" size="20" /&gt;
                                  &lt;input name="to" id="to" type="hidden" value="" /&gt;
                               
                                      &lt;p&gt;telefono&lt;/p&gt;&lt;input name="$$telefono$$" type="text" id="$$telefono$$" size="15" /&gt;

                                  &lt;p&gt;uc500&lt;/p&gt;&lt;input name="$$video1$$" type="radio" id="$$video1$$3" value="Unified Communications 500" checked="checked" /&gt;
                                  &lt;p&gt;asa5500&lt;/p&gt;&lt;input name="$$video1$$" type="radio" id="$$video2$$" value="ASA 5500" /&gt;
                               
                              &lt;input type="submit" value="Registrati" name="B12" /&gt;
                            
                          &lt;/form&gt;
</code></pre>
<p dir="auto">Dove sta l'errore?? In pratica non riesco a cambiare l'indirizzo di okURL al variare dell'opzione spuntata.</p>
<p dir="auto">Grazie a tutti.</p>
]]></description><link>https://dev.connect.gt/topic/87370/javascript-aiuto-form</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 01:05:35 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/87370.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 Nov 2008 13:06:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [javascript] Aiuto form on Tue, 11 Nov 2008 11:19:02 GMT]]></title><description><![CDATA[<p dir="auto">La tua pagina generata da dreamweaver e' un po' sporca e di difficile approccio per chi vuole darti una mano: proverei a semplificarla un po', cosi' da permettere una lettura piu' semplice.</p>
<p dir="auto">Per cio' che vuoi fare cmq basta qualcosa di questo tipo</p>
<pre><code class="language-html">&lt;html&gt;

&lt;head&gt;
&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type" /&gt;
&lt;title&gt;Valore 1  Valore 2  Valore 3&lt;/title&gt;
&lt;style type="text/css"&gt;
label {
    display: block;
}
&lt;/style&gt;
&lt;script type="text/javascript"&gt;
function setValue(currRadio){
    document.forms[0].testo.value = currRadio.value
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;
    &lt;form&gt;
        &lt;fieldset&gt;&lt;legend&gt;Scelta Valori&lt;/legend&gt;
        &lt;label&gt;Valore 1
            &lt;input name="valori" onclick="setValue(this)" type="radio" value="1" /&gt;
        &lt;/label&gt;
        &lt;label&gt;Valore 2
            &lt;input name="valori" onclick="setValue(this)" type="radio" value="2" /&gt;
        &lt;/label&gt;
        &lt;label&gt;Valore 3
            &lt;input name="valori" onclick="setValue(this)" type="radio" value="3" /&gt;
        &lt;/label&gt;
        &lt;label&gt;Valore Selezionato
            &lt;input name="testo" readonly="readonly" type="text" value="Nessuno" /&gt;
        &lt;/label&gt;
        &lt;/fieldset&gt;
    &lt;/form&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p dir="auto">Il doctype e' strict... l'ho rimosso perche' non sono premium : )</p>
]]></description><link>https://dev.connect.gt/post/780798</link><guid isPermaLink="true">https://dev.connect.gt/post/780798</guid><dc:creator><![CDATA[zakwer]]></dc:creator><pubDate>Tue, 11 Nov 2008 11:19:02 GMT</pubDate></item></channel></rss>