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

Home Forums CSS @CrocoDillon Website Contact Form

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #45586

    Yes, I checked out his website. I deliberated filled the contact form because I knew the data will not submit traditionally by having the browser loading to send the form and then echo a thank you message. I was expecting something ajaxing. And wow, I was right. The form freezed in a gray color, then slided right with a thank you bar replacing the submit button. Then under few seconds, the form slided back again in it’s former position.

    Before filling the form, I tried submitting it without filling the fields to see it’s reaction. And it reacted by shaking itself in a no-way-I-can’t-be-sent-like-that attitude.

    Please can someone explain to me the js and ajax behind those behaviours probably with a codepen sample.


    The code for that contact form its posted on his codepen account

    you can have a look there


    Here is my question. where does the form data sent to?


    In response to what you submitted: Hi back :P

    Yeah @pixelgrid is right, I created the Pen first to play around with the idea and then used almost the exact same JS live. Just view the source of that page, I kept everything inside the html because it’s not much code and only used on one page.


    > Here is my question. where does the form data sent to?

    The same page, I have to find a better solution for that (something that returns JSON with success or failure messages). Now it just waits for any response and assumes success. I will fix that but it’s not something that has high priority for me.


    @Crocodillon, thank u. I want to use the form in a website am working on right now. I have added the form and it’s behaving normally. But i want the data to be sent to a gmail account. How can i achieve that?


    I’d open a new thread for that. I have to go soon and can’t go into details. I’m using `ZendMail` (comes with Zend Framework 2 but can be used alone) and it’s as simple as:

    $mail = new Message(); // ZendMailMessage
    $mail->setFrom(‘[email protected]’);
    $mail->setTo(‘[email protected]’);
    $mail->setSubject(‘Contact Form’);
    “Name:nn{$data}nn” .
    “Email:nn{$data}nn” .
    try {
    $transport = new Sendmail(); // ZendMailTransportSendmail
    } catch (Exception $e) {}

    where $data is validated and sanitized.


    Ok. should i put these codes in between php tag and save it separately, then put the file name in my form action?

    Here is the form:


    if you will validate and send the emain from the same file change your file extension from .html to .php and make your validation at the top of the file inside tags.

    If you want the data to be validated in another file insert the file in the action attribute like action=’validate.php’;

    and create a new file from where you will validate and send your email.

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