Experiment 004 prova. ForMail creato con adobe photosho, concluso ed esportato come html in Image Ready.....
Con Dreamweaver.MX ho aggiunto sotto le funzioni esportate da Image Rady,questo:
E' definito il form con questo:codice:function controlla(a){ var fieldRequired = Array("nome","oggetto", "email","messaggio"); var fieldInput = Array("Nome","Oggetto", "E-Mail","Messaggio"); var alertMsg = "Per favore inserisci i seguenti campi:\n";var l_Msg = alertMsg.length; for (var i = 0; i < fieldRequired.length; i++){var obj = a.elements[fieldRequired[i]];if (obj){ switch(obj.type){case "text":case "textarea":if (obj.value == "" || obj.value == null){ alertMsg += " - " + fieldInput[i] + "\n";}break;default:if (obj.value == "" || obj.value == null){ alertMsg += " - " + fieldInput[i] + "\n";}}}}if (alertMsg.length == l_Msg){return true; }else{alert(alertMsg);return false;} }
Il Form Funziona!Ma questo codice dovrebbe impedire di lasciare i campi vuoti,avvertendo l'utente con un alert.!codice:<form id="form" onsubmit="controlla(this)" action="message.php" method="get" > . . . </form>
Non funge ,dove sbaglio?? la pagina e' questa potete dare un'occhiata al codice??
...........Grazie e buon lavoro a voi tutti........Michele R.

Rispondi quotando