Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    Controllino del codicino

    CIAO RAGAZZI NON SPAVENTATEVI....VOLEVO SOLO CHE QLK1 MI AIUTASSE DANDO UN'OCCHIATA A QUESTO CODICE....VORREI SAPERE COME POTREI
    INVIARE I DATI DEL CHECKBOX VIA WEB CON LO STESSO FUNZIONAMENTO DEI CAMPI TESTO <INPUT......VORREI CHE MI VENISSE INVIATO
    IL NOME DEL PRODOTTO E LA Q.Tà MA SOLO DI QUELLA DEL PRODOTTO CHECKato!!

    SPERO DI NON AVER FATTO TROPPA CONFUSIONE CON TUTTO QUESTO CODICE E LA MIA MACABRA SPIEGAZIONE!!!!


    dhò:




    (QUESTA E' LA FORM DOVE VENGONO DICHIARATI GLI OGGETTI E INVIATI)
    <TBODY>
    <tr>
    <TD>Nome</TD>
    <TD>
    <INPUT name=valore[9] size="20">
    </TD>
    </tr>
    </TBODY>


    <INPUT
    type=hidden value="Nome: " name=FormVal[9]>


    (QUI HO INSERITO un check box con 6 prodotti...NE RIPORTO UNO SOLO)


    <td width="255">
    <p align="center"><font color="#FF0000" face="Verdana">Prodotto</font></td>
    <td width="7"><font color="#FF0000" face="Verdana">Q.tà</font></td>
    </tr>
    <tr>
    <td width="255"><input type="checkbox" name="C1" value="ON"> Set di bambole gonfiabili</td>
    </center>
    <td width="7">
    <p align="center"><input type="text" name="T1" size="1"></td>





    (VI METTO ANCHE IL CODICE GIUSTO PER VEDERE IL FUNZIONAMENTO)

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

    function MM_validateForm() { //v4.0
    var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
    if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
    if (p<1 || p==(val.length-1)) errors+='- '+nm+' deve contenere un e-mail valido.\n';
    } else if (test!='R') {
    if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
    if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
    min=test.substring(8,p); max=test.substring(p+1);
    if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' è obbligatorio.\n'; }
    } if (errors) alert('Errori sui seguenti campi\n'+errors);
    document.MM_returnValue = (errors == '');
    }
    </script>
    </body>

  2. #2
    Moderatore di JavaScript L'avatar di br1
    Registrato dal
    Jul 1999
    Messaggi
    19,998
    Ti sei dimenticato di dare un'occhiatina al regolamentino... ed una ripassatina alla netiquette.

    Abbi pieta' delle xsone scarsamente avezze all'uso di neologismi, abbreviazioni, e ki + ne ha - ne metta: usa l'italiano.

    ciao
    Il guaio per i poveri computers e' che sono gli uomini a comandarli.

    Attenzione ai titoli delle discussioni: (ri)leggete il regolamento
    Consultate la discussione in rilievo: script / discussioni utili
    Usate la funzione di Ricerca del Forum

  3. #3

    ?????


    Anche tu non sei stato troppo chiaro....cmq ok

  4. #4
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    206
    potresti passare il nome del prodotto e la quantità direttamente nel value della check utilizzando una loggica del genere:

    crei il tuo check in questo modo:

    <input type="checkbox" name="C1" value="nomeprod_quantita">

    poi lato server fai uno split sul "_"

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.