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

    Aiuto per campi obbligatori formail php

    Ho un formail in actionscrip collegato a un mailform.php per l'invio di dati e, nel form iniziale, erano previsti 3 campi obbligatori:
    fname, lname, email. Io devo aggiungere come obbligatori anche telno e comments... ho scasinato un pò e ora se lascio il formail in bianco mi dice anche in quei campi che dovevano essere compilati, ma se compilo i primi 3 campi e faccio invia manda il messaggio senza ritornare l'errore...

    qualcuno mi da una mano?

    il codice associato è questo :



    fscommand ("allowscale", "false");
    fname1.tabIndex = 1;
    lname1.tabIndex = 2;
    email1.tabIndex = 3;
    telno1.tabIndex = 4;
    comments1.tabIndex = 5;
    mailform = "mailform.php";
    confirm = "please wait for confirmation ..."
    action = "send";
    Selection.setFocus("fname");
    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);
    }
    function formcheck () {
    if ((((email == null)) || (email.length<1)) || (email == "ERROR! Address not valid")) {
    email = "ERROR! Address not valid";
    action = "";
    }
    if (!validate(email)) {
    email = "Address not valid";
    action = "";
    }
    if ((((fname == null)) || (fname.length<1)) || (fname == "ERROR! Address not valid")) {
    fname = "Name required";
    action = "";
    }
    if ((((lname == null)) || (lname.length<1)) || (lname == "ERROR! Address not valid")) {
    lname = "Name required";
    action = "";
    }

    if ((((telno == null)) || (telno.length<1)) || (telno == "ERROR! Address not valid")) {
    telno = "Name required";
    action = "";
    }
    if ((((comments == null)) || (comments.length<1)) || (comments == "ERROR! Address not valid")) {
    comments = "Name required";
    action = "";
    }

    if ((validate(email)) && (email != "ERROR!") && (fname != "") && (lname != "") && (telno != "") && (comments != "")) {
    action = "send";
    loadVariablesNum (mailform, 0, "POST");
    gotoAndPlay ("wait");
    }
    }
    stop ();
    "Style is the most important thing! It defines who you are" (Vulcan)

    Futura Immagine - Ultimi lavori

    Seil2 - I Diari della Lettera

  2. #2
    help
    "Style is the most important thing! It defines who you are" (Vulcan)

    Futura Immagine - Ultimi lavori

    Seil2 - I Diari della Lettera

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.