Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2003
    Messaggi
    168

    Inserire in un form dei radio button

    Salve!!
    ho un form che invia dei dati a php, con questa azione

    on (release) {
    formcheck();
    }

    e la funzione è:

    fscommand ("allowscale", "false");
    //
    // set some variables
    //
    mailform = "mailform.php";
    //confirm = "per favore attendere la conferma..."
    action = "send";
    //
    // and focus on variable fname
    //
    Selection.setFocus("fname");
    //
    // validate email function
    //
    function validate (address) {
    if (address.length>=7) {
    if (address.indexOf("@")>0) {
    if ((address.indexOf("@")+2)<address.lastIndexOf(".") ) {
    if (address.lastIndexOf(".")<(address.length-2)) {
    return (true);
    }
    }
    }
    }
    return (false);
    }
    //
    //form check
    //
    function formcheck () {
    if ((((email == null)) || (email.length<1)) || (email == "ERRORE! Indirizzo non valido")) {
    email = "ERRORE! Indirizzo non valido";
    action = "";
    }
    if (!validate(email)) {
    email = "ERRORE! Indirizzo non valido";
    action = "";
    }
    if (fname == null) {
    fname = "ERRORE! Campo Richiesto";
    action = "";
    }
    if (lname == null) {
    lname = "ERRORE! Campo Richiesto";
    action = "";
    }
    if ((validate(email)) && (email != "ERROR!") && (fname != "") && (lname != "")) {
    action = "send";
    loadVariablesNum (mailform, 0, "POST");
    this.gotoAndPlay ("wait");
    }
    }
    stop ();


    io ho aggiunto 3 radio button, e con

    trace(radioGroup.getValue() )

    mi da il valore... come posso fare x inserirlo nella variabile che spedisco?

    grazie mille!!

  2. #2
    codice:
    function formcheck() {
    	if ((((email == null)) || (email.length<1)) || (email == "ERRORE! Indirizzo non valido")) {
    		email = "ERRORE! Indirizzo non valido";
    		action = "";
    	}
    	if (!validate(email)) {
    		email = "ERRORE! Indirizzo non valido";
    		action = "";
    	}
    	if (fname == null) {
    		fname = "ERRORE! Campo Richiesto";
    		action = "";
    	}
    	if (lname == null) {
    		lname = "ERRORE! Campo Richiesto";
    		action = "";
    	}
    	
    	radioButton = radioGroup.getValue();
    	
    	if ((validate(email)) && (email != "ERROR!") && (fname != "") && (lname != "")) {
    		action = "send";
    		loadVariablesNum(mailform, 0, "POST");
    		this.gotoAndPlay("wait");
    	}
    }
    stop();
    ovviamente all'interno di php dovrai ricevere oltre alle altre variabile anche radioButton.

    regalami un oggi da favola...e il domani bhe!?non mi importa se tu 6 con me! ©Ily

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.