Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Contact Form: Validation & Deployment

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30527
    Travis Love
    Participant

    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.

    #78246
    darkporn
    Member

    cubedMedia, 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 plugin

    http://bassistance.de/jquery-plugins/jquery-plugin-validation/

    validate plugin

    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 but


    tag 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

    #77826
    Travis Love
    Participant

    Thanks for the help, this should get me going. I appreciate the time put into the PHP for me.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.