[PIPython] ciclo sui result di una select box multipla

mtzolo a gmail.com mtzolo
Lun 16 Gen 2006 12:23:06 CET


OK:
 par_1['', '', '', '', '']city'6's_dd'01'code'tenco'66'63'observer''title
'luigi'country'6'region'1'67'63's_yyyy'2001'e_yyyy'2010'nat_traincenter'15'
63'63's_mm'01'65'63'geographical'1'type'1'64'63'e_dd'10'e_mm'10' e(lunghino
anche se sfrondato di js e css & Co... ma mi pare cmq chiaro):
<form name="module" action="insert_activities_py" method="post"
onsubmit="javascript: alert(eval('document.module.sel2.options
[0].value;'));">
<h1>Insert a new activity</h1><br>
<table>
<tbody>



<tr>
<th align="right">Title</th>
<td colspan="3"><input value="" name="title" type="text" size="60"
maxlength="200"></td><td colspan="2"></td>
</tr>
<tr>
<th align="right">Code</th>
<td><input value="" name="code" type="text" size="10"
maxlength="20"></td><td colspan="2"></td>
</tr>
<tr>
<th align="right">Nat traincenter</th>
<td>

<select name="nat_traincenter">
   <div>
         <div>
         <option value="15">
         torino / de giorgi school</option>
         </div>
         <div>
         <option value="16">

         roma / de lorenzi sanita'</option>
         </div>
         <div>
         <option value="17">
         Torino / pippi</option>
         </div>
         <div>
         <option value="18">

         None / None</option>
         </div>
         <div>
         <option value="19">
         Torino / Centro Formazione CGIL</option>
         </div>
   </div>
</select>

</td><td colspan="2"></td>
</tr>
<tr>
<th align="right">Country*</th>
<td>
<select name="country" class="requested">
   <div>
         <div>
         <option value="6">
         04 / Brasil</option>
         </div>

         <div>
         <option value="4">
         02 / Deutschland</option>
         </div>
         <div>
         <option value="5">
         03 / france</option>
         </div>

         <div>
         <option value="3">
         01 / Italia</option>
         </div>
         <div>
         <option value="8">
         No / None</option>
         </div>

         <div>
         <option value="7">
         05 / USA</option>
         </div>
   </div>
</select>
</td><td colspan="2"></td>
</tr>
<tr>
<th align="right">Region*</th>

<td>
<select name="region" class="requested">
   <div>
         <div>
         <option value="1">
         North America</option>
         </div>
         <div>
         <option value="2">

         Latin America</option>
         </div>
         <div>
         <option value="9">
         Europe</option>
         </div>
         <div>
         <option value="5">

         Asia and the Pacific</option>
         </div>
         <div>
         <option value="7">
         Africa</option>
         </div>
   </div>
</select>

</td><td colspan="2"></td>
</tr>
<tr>
<th align="right">City</th>
<td>
<select name="city">
   <div>
         <div>
         <option value="6">
         Roma  </option>
         </div>

         <div>
         <option value="7">
         Berlino  </option>
         </div>
         <div>
         <option value="8">
         Paris  </option>
         </div>

         <div>
         <option value="9">
         New York  </option>
         </div>
         <div>
         <option value="10">
         San Paulo  </option>
         </div>

         <div>
         <option value="11">
         Torino  </option>
         </div>
   </div>
</select>
</td><td colspan="2"></td>
</tr>
<tr>
<th align="right">Start date*</th>

<td><input value="" name="s_dd" type="text" size="2" maxlength="2"
class="requested"><input value="" name="s_mm" type="text" size="2"
maxlength="2" class="requested"><input value="" name="s_yyyy" type="text"
size="4" maxlength="4" class="requested"> (dd/mm/yyyy)</td>
<td colspan="2"></td>
</tr>
<tr>
<th align="right">End date*</th>
<td><input value="" name="e_dd" type="text" size="2" maxlength="2"
class="requested"><input value="" name="e_mm" type="text" size="2"
maxlength="2" class="requested"><input value="" name="e_yyyy" type="text"
size="4" maxlength="4" class="requested"> (dd/mm/yyyy)</td>
<td colspan="2"></td>
</tr>
<tr>
<th align="right">Type</th>
<td>

<select name="type">
   <div>
         <div>
         <option value="1">
         conference  </option>
         </div>
         <div>
         <option value="2">
         training/education  </option>

         </div>
         <div>
         <option value="3">
         advisory services  </option>
         </div>
         <div>
         <option value="0">
         None  </option>

         </div>
   </div>
</select>
</td><td colspan="2"></td>
</tr>
<tr>
<th align="right">Geographical</th>
<td>
<select name="geographical">
   <div>
         <div>
         <option value="1">

         national activity  </option>
         </div>
         <div>
         <option value="2">
         subregional activity  </option>
         </div>
         <div>
         <option value="3">

         regional activity  </option>
         </div>
         <div>
         <option value="6">
         global/interregional activity  </option>
         </div>
         <div>
         <option value="0">

         None  </option>
         </div>
   </div>
</select>
</td><td colspan="2"></td>
</tr>
<tr><th colspan="4"><hr><br><br>Invitation list<br><br></th></tr>
<!-- INVITATION LIST FORZATA CON 10 SELECT -->
<!-- INVITATION LIST FORZATA CON 10 SELECT -->
<!-- INVITATION LIST FORZATA CON 10 SELECT -->
<tr><th align="right">Titulars</th>

<td>
<select name="org" multiple="multiple">
   <div>
         <div>
         <option value="63">
         CGIL TORINO  </option>
         </div>
         <div>
         <option value="64">

         CGIL ROMA  </option>
         </div>
         <div>
         <option value="65">
         None  </option>
         </div>
         <div>
         <option value="66">

         None  </option>
         </div>
         <div>
         <option value="67">
         Confederazione Generale Italiana del Lavoro  </option>
         </div>
   </div>
</select>

</td>
<td width="30px">
<input type="button" value="--&gt;" onclick="deleteall();ret=max20(
this.form.org, this.form.sel2); if (ret!=0) {moveOptions(this.form.org,
this.form.sel2);}" /><br />
            <input type="button" value="&lt;--" onclick="moveOptions(
this.form.sel2, this.form.org);deleteall();" />
</td><td>
<select name="sel2" id="sel2" size="10" multiple="multiple"></select>

<br><br><input type="button" value="calculate" onclick="crea1();">


</td></tr>



<tr><th align="right">Substitute</th>

<td>
<select name="org1" multiple="multiple">
   <div>
         <div>
         <option value="63">
         CGIL TORINO  </option>
         </div>
         <div>
         <option value="64">

         CGIL ROMA  </option>
         </div>
         <div>
         <option value="65">
         None  </option>
         </div>
         <div>
         <option value="66">

         None  </option>
         </div>
         <div>
         <option value="67">
         Confederazione Generale Italiana del Lavoro  </option>
         </div>
   </div>
</select>

</td>
<td width="30px">
<input type="button" value="--&gt;" onclick="ret=max20(this.form.org1,
this.form.sel3); if (ret!=0) {moveOptions(this.form.org1, this.form.sel3);}"
/><br />
            <input type="button" value="&lt;--" onclick="moveOptions(
this.form.sel3, this.form.org1);" />
</td><td>
<select name="sel3" size="10" multiple="multiple"></select>
</td></tr>


<tr>
<th align="right">Observer</th>
<td colspan="3">
<textarea name="observer" cols="40" rows="10"></textarea></td><td
colspan="2"></td>
</tr>
<tr>



<!-- LIST OF PARTECIPANTS FORZATA CON 10 SELECT -->
<!-- LIST OF PARTECIPANTS FORZATA CON 10 SELECT -->
<!-- LIST OF PARTECIPANTS FORZATA CON 10 SELECT --></tr>
<tr><th colspan="4"><br><br>List of partecipants<br><br></th></tr>
<tr><td colspan="4" id="nonno"><div id="appenderequi"></div></td></tr>
<div>
<div>
<tr><td></td><td>
          <select name="63">
                    <div>
                              <div>

                              <option value="63">
                              CGIL TORINO  </option>
                              </div>
                              <div>
                              <option value="64">
                              CGIL ROMA  </option>
                              </div>
                              <div>

                              <option value="65">
                              None  </option>
                              </div>
                              <div>
                              <option value="66">
                              None  </option>
                              </div>
                              <div>

                              <option value="67">
                              Confederazione Generale Italiana del Lavoro
</option>
                              </div>
                    </div>
          </select>
</td>
<td colspan="2"><input value="" name="par_1" type="text" size="30"
maxlength="50"></td>
</tr>
</div>
<div>
<tr><td></td><td>

          <select name="64">
                    <div>
                              <div>
                              <option value="63">
                              CGIL TORINO  </option>
                              </div>
                              <div>
                              <option value="64">

                              CGIL ROMA  </option>
                              </div>
                              <div>
                              <option value="65">
                              None  </option>
                              </div>
                              <div>
                              <option value="66">

                              None  </option>
                              </div>
                              <div>
                              <option value="67">
                              Confederazione Generale Italiana del Lavoro
</option>
                              </div>
                    </div>
          </select>

</td>
<td colspan="2"><input value="" name="par_1" type="text" size="30"
maxlength="50"></td>
</tr>
</div>
<div>
<tr><td></td><td>
          <select name="65">
                    <div>
                              <div>
                              <option value="63">
                              CGIL TORINO  </option>

                              </div>
                              <div>
                              <option value="64">
                              CGIL ROMA  </option>
                              </div>
                              <div>
                              <option value="65">
                              None  </option>

                              </div>
                              <div>
                              <option value="66">
                              None  </option>
                              </div>
                              <div>
                              <option value="67">
                              Confederazione Generale Italiana del Lavoro
</option>

                              </div>
                    </div>
          </select>
</td>
<td colspan="2"><input value="" name="par_1" type="text" size="30"
maxlength="50"></td>
</tr>
</div>
<div>
<tr><td></td><td>
          <select name="66">
                    <div>
                              <div>

                              <option value="63">
                              CGIL TORINO  </option>
                              </div>
                              <div>
                              <option value="64">
                              CGIL ROMA  </option>
                              </div>
                              <div>

                              <option value="65">
                              None  </option>
                              </div>
                              <div>
                              <option value="66">
                              None  </option>
                              </div>
                              <div>

                              <option value="67">
                              Confederazione Generale Italiana del Lavoro
</option>
                              </div>
                    </div>
          </select>
</td>
<td colspan="2"><input value="" name="par_1" type="text" size="30"
maxlength="50"></td>
</tr>
</div>
<div>
<tr><td></td><td>

          <select name="67">
                    <div>
                              <div>
                              <option value="63">
                              CGIL TORINO  </option>
                              </div>
                              <div>
                              <option value="64">

                              CGIL ROMA  </option>
                              </div>
                              <div>
                              <option value="65">
                              None  </option>
                              </div>
                              <div>
                              <option value="66">

                              None  </option>
                              </div>
                              <div>
                              <option value="67">
                              Confederazione Generale Italiana del Lavoro
</option>
                              </div>
                    </div>
          </select>

</td>
<td colspan="2"><input value="" name="par_1" type="text" size="30"
maxlength="50"></td>
</tr>
</div>
</div>


<tr>
<th></th>
<td><input type="submit" value="insert" class="submit"></td>
</tr>
</tbody>
</table>
</form>


    <div id="standard-html-footer">

<div id="foot">Labour Education Database</div>
</div>
  </body>
</html>



Matteo
======================================================
On 1/16/06, Fabrizio Reale <realefab a zschool.org> wrote:
>
>
>
> Il giorno lun, 16/01/2006 alle 11.57 +0100, mtzolo a gmail.com ha scritto:
> > 1. si DB non Mysql, ma n e' roba mia e devo usare Mysql ^_^
>
> Peccato :)
>
> >
> > 2. return context.REQUEST funziona, MA non mi parla della variabile
> > slect ma degli opstions(name= 63,64,65,66,67). E' corretto? cosi' n
> > POTREI ciclare sui result ma dovrei conoscrere di volta in volta i
> > nomi degli options, che sono realizzati run-time dinamicamente. In
> > piu' (essendoci 2 select, la seconda delle quali valorizzata
> > dall'utente via JS dalle scelte effettuate sulla prima select), MI
> > PARE che il REQUEST tenga solo i valori gia' impostati al momento
> > della generazione della paginan lato server....:
>
> Riporta anche il codice html del tuo form (non tutta la pagina).
> Fabry
>
>
> --
> Fabrizio Reale                               fabrizio.reale a redomino.com
> Redomino S.r.l.            C.so Monte Grappa 90/b - 10145 Torino - Italy
> Tel: +39 011 19502871 - Fax: +39 011 19502871 - http://www.redomino.com/
>
>
>
> _______________________________________________
> La mailing list di python.it
> python a lists.python.it
> http://lists.python.it/cgi-bin/mailman/listinfo/python
>
>
>


--
Quando sento Berlusconi dire che vuole trasformare lo stato in un'azienda...
Mi domando sempre quando inizierÓ l'OPA
-------------- parte successiva --------------
Un allegato HTML Ŕ stato rimosso...
URL: http://list.zope.it/pipermail/python/attachments/20060116/0e427d9c/attachment-0001.html


More information about the Python mailing list