Home › Forums › JavaScript › Contact Form: Validation & Deployment
- This topic is empty.
-
AuthorPosts
-
October 11, 2010 at 6:01 pm #30527Travis LoveParticipant
Hey There,
I am currently finishing up my associates for web design and struggling heavily with JS. I have started learning jQuery which is a big help and much simpler to understand thanks to css selectors.
But as I go deeper into JS I am continuing to find it hard to learn, but alas that is not why I am hear. I am trying to finish my own site and many others and continuing to hit the road block of finding a functional “site-to-email” contact form. I can code it in HTML and CSS perfectly, and can get JS to do the standard “onclick” functionality stuff. But I can’t seem to find anywhere tutorials or even understandable code for contact form validation. I also do not have any understanding of what to do after it is validated. I know the action = “post” part, but I do not know PHP to code further validation and submitting to the server either. Sometimes this concerns me as a new designer that my knowledge of HTML and CSS mean nothing if I can’t grasp the simple concepts of JS and PHP.
I have heard about validation libraries, but not sure if these are simple “drag and drop” scripts, seeing as I can code the form myself.
Thanks for the help.
October 12, 2010 at 2:12 pm #78246darkpornMembercubedMedia, i saw your site, i think is this, http://www.cubedmedia.com/ right?
first.
if you have your own domain, use it, don’t put a mailto:*@bellsouth.
create you email address, like, [email protected]second
jQuery, do not, send email, ok? but you can easily validate the form with the validate pluginhttp://bassistance.de/jquery-plugins/jquery-plugin-validation/
php send email, you know this,
you can also validate here, but is more work.
for send a email you should use the mail() function
I am from Chile so the code is in spanish.$Nombre = htmlspecialchars($_POST[Nombre]);
$email= htmlspecialchars($_POST[email]);
$fono = htmlspecialchars($_POST[fono]);
$mensaje = htmlspecialchars($_POST[mensaje]);
$recipiente = "YOUR EMAIL ADDRESS";
$sw = "index.php";
$msg = "El Sr: $Nombre, envia el formulario con los siguientes datos:nnnn
Nombre: $Nombre
e-mail: $email
Fono: $fono
Mensaje: $mensajenn";
if (empty($Nombre)){
echo "Error: No ha
";
ingresado su Nombre.
} else if(empty($fono)){
echo "Error: No ha
";
ingresado su Telefono.
} else if(empty($mensaje)){
echo "Error: No ha
ingresado su Mensaje.";
}else{
//Limpiamos de posibles ataques.
$mensaje = ereg_replace("rn","
", $mensaje);
mail("$recipiente", "YOUR TITLE", "$msg", "FROM: $email");
echo"Señor/es $Nombre.
Le agradecemos de antemano la confianza depositada en nuestra empresa.
Le informamos que hemos recibido su petición de información correctamente
y en breves fechas nos pondremos en contacto con usted.
Atte. MI EMPRESA.
Volver a la pagina de inicio.";
}
?>you can translate with the translate.google.com service.
( strange buttag is tranlate as FACEBOOK )
look at the variables $_POST because your input need to name as it.
ex.
html page.the class required is for validate plugin works
the name = email send to php page as
$_POST
any question. just ask
October 19, 2010 at 5:04 pm #77826Travis LoveParticipantThanks for the help, this should get me going. I appreciate the time put into the PHP for me.
-
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.