• User Newbie

    Form: eliminare le scritte all'interno dei campi

    Ciao

    ho creato un form, appoggiato ad un file php...

    questo è il codice:

    function resetCampo() {

    nome_txt.inputColor("NOME:", "0xFFFFFF", "0xFFFFFF");
    email_txt.inputColor("EMAIL:", "0xFFFFFF", "0xFFFFFF");
    msg_txt.inputColor("MESSAGGIO:", "0xFFFFFF", "0xFFFFFF");
    _root.status_txt.text = "";
    nome_txt.text = "NOME:";
    email_txt.text = "EMAIL:";
    msg_txt.text= "MESSAGGIO:";
    Selection.setFocus(undefined);
    }
    limpar_bt.onRelease = resetCampo;
    enviar_bt.onRelease = function() {
    mailTrue = email_txt.text;
    if (nome_txt.text == "NOME:") {
    nome_txt.colorTo("0xff3300", 1);
    nome_txt.colorTo("0x666666", 1, "", 2);
    } else if (email_txt.text == "EMAIL:" || mailTrue.isEmail() != true) {
    email_txt.colorTo("0xff3300", 1);
    email_txt.colorTo("0x666666", 1, "", 2);
    } else if (msg_txt.text == "MESSAGGIO:") {
    msg_txt.colorTo("0xff3300", 1);
    msg_txt.colorTo("0x666666", 1, "", 2);
    }
    //else {
    //php_nome = _root.nome_txt.text;
    //php_email = _root.email_txt.text;
    //php_msg = _root.msg_txt.text;
    loadVariables("output.php", this, "POST");
    status_txt.text = "INVIATO!";
    nome_txt.inputColor("NOME:", "0x666666", "0x000000");
    email_txt.inputColor("EMAIL:", "0x666666", "0x000000");
    msg_txt.inputColor("MESSAGGIO:", "0x666666", "0x000000");
    this.onData = function() {
    if (this.output == "sent") {
    _root.status_txt.text = "INVIATO!";
    resetCampo();
    } else {
    _root.status_txt.text = "ERRORE!";
    }
    // end else if
    };
    }
    // end else if
    //};
    resetCampo();

    All'interno dei rettangoli del form mi rimane scritto:

    Nome:
    Email:
    Messaggio:

    e va bene, però io vorrei che quando clicco all'interno della casella, queste scritte scompaiano.

    COme faccio?