LightForm - Free Ajax/php contact form

February 7, 2008

AJAX / Javascript, All, Forms, Freebies, HTML / CSS, PHP

LightForm ::: Free Ajax/PHP Contact Form

Article written by Jeeremie

LightForm is NO LONGER MAINTAINED!

You can still download it but there will not be any future releases and support for this script.

(Please, do not contact me by email regarding this script. I won't reply).

LightForm is a free Ajax/PHP contact form. It combines FormCheck2 for fields validation and NiceForms to style text fields and textareas.

Preview / Download

lightformpreview.jpg

DemoDownload(381.5 KiB, 193,721 hits)

Use of this contact form is free of charge but the copyright notes in the footer must remain intact.
I would appreciate if you send me the URI of your site if you use LightForm.

Changelog:

October 09, 2008: LightForm now works with Niceforms 1.0 which allows to a set a different size for inputs, textareas and buttons. Input bug fixed in IE8 and files have been compressed to improve load time (just one stylesheet and only one images folder. All the javascripts are in the same folder).
May 28, 2008: Textarea bug fixed.

Features:

  • Form Validation using FormCheck2.
  • Spam Check.
  • Display user IP, user agent and referrer in the message.
  • Display a dialog box when message sent succesfully.
  • Inputs and textareas are styled with NiceForms.
  • Works in the most recent browsers (IE6+, Firefox, Opera, Safari and Netscape).

Installation:

  1. Download and unzip the file
  2. Copy all the files to your root Directory

Usage:

Open index.php in your web editor (e.g. Notepad) and change the email address line 55:
$to = 'yourname@domain.com';

License:

The CSS, XHTML, PHP and design is released under Creative Commons Attribution v2.5.

FormCheck2 is released under the MIT license.

NiceForms is released under no specific license. You are free to use and modify but you must provide credits to the author.

Caution

Form validation won’t work anymore if users disable Javascript.

The Author

Article written by Jeeremie:

Hi, My Name is Jeremie Tisseau. I am a French UI/UX Designer, Event Organizer and Web Entrepreneur based in Bangkok, Thailand, since January 2009. I design beautiful and functional web and mobile apps for early stage startups.

Want to become a guest author on this blog?

163 Comments

  1. zack says:

    7 Mar, 2008

    Great. It works smoothly.Firebug detects a slight error on the congrats page though:obj has no properties while (obj.offsetParent) {on line190 of niceforms.jsKeep up the good work.

  2. dora says:

    18 Mar, 2008

    It looks beautiful!Good work!I’ve translated it a little to Simple Chinese.You can visit it here.

  3. artico says:

    25 Mar, 2008

    Hi there, i got a question about this form…How I can change the question and of course the answer of the part “are you human?” I really don’t know much of javascript.I appreciate any help, thanks.

  4. Jeremie Tisseau says:

    25 Mar, 2008

    Artico,

    open index.php in a web editor and go to line 152 and change the text:
    <label for="spamcheck"><span class="blue">*</span> <acronym title="[ Spam prevention ]"><strong>Are you human?</acronym> : <span class="blue">2 + 3 = ???</span></strong></label>

    To change the answer, open /js/formcheck/formcheck.js and go to line 155:
    spamcheck : /^[5]+$/,
    … and change number 5 for another number.

    You must also change the question line 136 to match your answer:
    spamcheck : "2 + 3 = ???"

    Let me know if you could do it.

  5. artico says:

    26 Mar, 2008

    Hi Jeremie Tisseau, that was easy to change, thanks for your help.

  6. paco says:

    22 Apr, 2008

    I wanted to know how could I add some radio and checkboxs to my form, because they don’t appear…Thank a lot!

  7. Jeremie Tisseau says:

    22 Apr, 2008

    It is normal Paco, I didn’t create radio and checkboxes images for this form. If you really need some for your form, go to Badboy.ro and download his form to get the images.

    I hope it helps.

  8. Paco says:

    22 Apr, 2008

    Merci pour le lien!!Oh j’avais pas vu que tu étais francais, j’ai parlé anglais pour rien :)Bonne continuation, et pour le blog, il va droit dans mes RSS ^^…

  9. Peekholes says:

    24 Apr, 2008

    IS it easy to add more fields?

  10. JP says:

    25 Apr, 2008

    Very nice! how can i put this form into my About page in WordPress?Thanks!

  11. JP says:

    25 Apr, 2008

    Hi again, i translate the “LightForm\js\formcheck\lang” formcheckLanguage = {    required     : “Campo requerido.”,    alpha        : “Este campo acepta solo caracteres alfabéticos.”,    alphanum     : “Este campo acepta solo caracteres alfanuméricos.”,    nodigit      : “No se aceptan dígitos.”,    digit        : “por favor ingrese un número válido.”,    digitmin     : “El número debe ser de al menos %0″,    digitltd     : “El valor debe estar entre %0 y %1″,    number       : “Por favor ingrese un número válido.”,    email        : “Por favor ingrese un email válido:”,    email        : “Ingrese un email válido: <br /><span>Ej. sunombre@dominio.com</span>”,    spamcheck    : “<span>2 + 3 = ???</span>”,    phone        : “Ingrese un teléfono válido.”,    url          : “Ingrese una URL válida: <br /><span>E.g. http://www.dominio.com</span&gt;”,    confirm      : “Este campo es diferente de  %0″,    differs      : “Este campo tiene que ser diferente de %0″,    length_str   : “Texto muy corto, tiene que ser entre %0 y %1″,    lengthmax    : “Texto muy corto, debe tener un máximo de %0″,    lengthmin    : “Texto muy corto, debe tener por lo menos %0″,    checkbox     : “Por favor marque el chekbox”,    radios       : “Por favor seleccione un radio”,    select       : “Por favor seleccione un valor”}If you want i can translate all files, please help me with WordPress!Thanks again

  12. Alex says:

    1 May, 2008

    I quite like this contact form you have made.If you are using this on your website then I reccomend you download the YUI Compressed mootools as it is only 65kb compared to the supplied 180kb.I am currently trying to turn this into a simple wordpress plugin.  It wont have any of the fancy functionality and admin interface of cforms though but you should still be able to get it to work with minimal php/html coding

  13. Jeremie Tisseau says:

    1 May, 2008

    Thanks for the info. I didn’t know about this YUI compressed tool. That’s good to know.

    It would be great you create a wordpress plugin. Let us know about it.

  14. Lawrence Salberg says:

    8 May, 2008

    Copyright in footer? How can you copyright this? You don’t have rights to standard scripting methods of JavaScript and PHP. Hey, it’s a nice form – don’t get me wrong – but think about how much you’ve been given by the community in terms of free info/advice on forums, and great languages like PHP and JS. To be part of the community, you have to give back. If you are going to “protect” your work, consider a Creative Commons license – which is a lot different than a copyright (which implies that you own all the intellectual property associated with your work – which you don’t).Better yet, just request that people give you credit – you’ll find most will – especially if they can post your Googlicious inbound link to a “credits” page somewhere on their site.Else bundle it up with LTS and charge for it.

  15. Jeremie Tisseau says:

    8 May, 2008

    Lawrence,

    Did you have a bad day? Where have you seen I put copyright by web-kreation? I say in the footer:
    “© Some Copyrights by their respective authors (if you are not sure visit authors’ websites).”

    This means copyrights by Moo Floor and BadBoy.ro for the PHP and JS.

    I have never pretended I knew any PHP or JS, neither I have intented to create something original. I just wanted to create a nice form using some existing scripts that I liked very much. And since I liked the result, I wanted to share it with others. Is there something wrong with that?

    Moreover, I say on my blog:
    “The CSS, XHTML, PHP and design is released under Creative Commons Attribution v2.5.”

    So next time, before you insult someone, read!!!!

    I am now waiting for your apologies.

  16. Lawrence Salberg says:

    8 May, 2008

    Hmmm…. no, not having a bad day. Just thought you didn’t know about that stuff. Turns out you do. Which is great. I first read about the copyright requirement on Smashing Apps here and then saw the same phrase repeated in the Download section above: “Use of this contact form is free of charge but the copyright notes in the footer must remain intact.”So, yeah, I, uh, apologize for not reading further and seeing the license information below. And for everyone’s benefit, the license info is in fact repeated in the actual php script download (not that I looked before).So, now that I apologized, I hope you’ll forgive me. Now, that I see the license info, all I can say is that it is, at best, a bit confusing – or perhaps conflicting information. Even if I had read down to the License section, I’m not sure I would have known which information supersedes which. But, I probably would have left a different comment entirely, admittedly. One asking a question, rather than assuming. You got me – two points for you. Your ball.

  17. Jeremie Tisseau says:

    9 May, 2008

    Yes, don’t worry. I accept your apologies. That’s not a big deal.

    Cheers!

  18. Ivo says:

    14 May, 2008

    its possible add new list menu or drop down menu in your script?whow? i try insert this list menu but i dont see nothing when i try in server!! can you explain me whow to work?thanks

  19. Quintin says:

    14 May, 2008

    ack Said:

    “Great. It works smoothly.Firebug detects a slight error on
    the congrats page though:obj has no properties while (obj.offsetParent)
    {on line190 of niceforms.jsKeep up the good work.”I have the same experience. Other than that it all works fine. Thank you for sharing this piece of work.

  20. otavio says:

    21 May, 2008

    CARAAAAAA!!! vc me ajudou muito valeu mesmo. Espero manter contato

  21. mmartinovich says:

    24 May, 2008

    Hey! Love your stuff!
    I have a problem… I did everything right and it just won’t send email… it just gives me error…your massage faild to send!
    I can see css, nice form, form check works… it just wont send…

    thx!

  22. Jeremie Tisseau says:

    24 May, 2008

    @ mmartinovich: The script works fine. I have tried it few times and i could always send mail. Could it be a problem with your server or email address?

  23. mmartinovich says:

    24 May, 2008

    Everything is fine on server when I use another script… it sends I get it…
    Seems something is going on with send mail command…I can’t figure it out… everything works smooth except it won’t send…
    Once when I used another script it said ” You are coming from unauthorized domain… could it be something with this thing?

    Can you write down a send mail part of script ’cause I’m not so good with PHP…please! I love this thing! You did awsome job!
    I just HAVE to make it work!

    thx!

  24. mmartinovich says:

    25 May, 2008

    Ok… i figuered out why it wouldnt want to send email…
    had to add this line before mail function:
    ini_set(“sendmail_from”, “postmaster@domain.com”);

    Now it works like a charm!
    THX, bro!

  25. Jose Ramon says:

    27 May, 2008

    I am using your plugin in a wordpress page and I would like to have two different forms: a contact form and another one.
    I tryed to do that by having two plugins with different names but the same one and change the form in one of them. But the problem is that both appear with the code [lightform].
    Is there a way of having different forms that will show with different code in the posts?

    Thanks.

  26. Jeremie Tisseau says:

    27 May, 2008

    Jose,
    Do you have a url?

  27. Jose Ramon says:

    28 May, 2008

    This is my URL.

    Thanks.

  28. playmos says:

    29 May, 2008

    nice job man!
    very useful
    it was not 100% clear to me how text and translations are managed but now i think i’ve got them :)

  29. Allen says:

    29 May, 2008

    Hi,

    First, THANK YOU for this awesome contact form.

    Second, is there a way to limit a user’s URL input in the message box to at least 3? Spammers usually sends dozens of them. So I think this would be another good way to avoid spam.

    Thanks again and more power!

    _a

  30. Allen says:

    29 May, 2008

    If it’s not possible, is there a way to ban some specific words like ‘viagra’ in the message box?

    I actually tried doing it (please don’t laugh I’m no expert) but only works with one character (like ‘v’ ‘i’ ‘a’ ‘g’ ‘r’ ‘a’) :

    noviagra : /^[^"viagra"]+$/i,

    How to make it so it’s the whole word (“viagra” itself)?

    Thanks!

  31. mache says:

    30 May, 2008

    I’m using the wp plugin with your form. it’s working very good!
    just to send you the link to my web, as you asked for it.
    thanks again

  32. Jeremie Tisseau says:

    30 May, 2008

    Thank you Mache. However, it is Alex rogers you should thank for porting LightForm to WordPress.

  33. Alex says:

    4 Jun, 2008

    Can someone tell me how I can redirect to a different page instead of going back to the source page?

  34. Justin says:

    4 Jun, 2008

    I’m getting this error:

    Firefox can’t find the file at /Users/laurenyoung/Sites/parsec/LightForm/.

    don’t know why…

    form looks great, I’d like to use it, if i can get this error thing figured out!

  35. Jeremie Tisseau says:

    4 Jun, 2008

    @ Alex: Open index.php and go to line 189. Change the message for this:

    <div class=\"MsgSent\">
    <h1>Congratulations!!</h1>
    <p>Thank you <b><?=$name;?></b>, your message is sent!<br /> I will get back to you as soon as possible.</p>
    <script type=\"text/JavaScript\">
    <!--
    setTimeout(\"location.href = \\'http://www.yoursite.com\\';\",5000);
    -->
    </script>
    <p>Please, be patient. You will be redirected to the home page in 5 secondes.</p>
    </div>

    Don’t forget to change “yoursite.com” for your site. The script will redirect the visitor to the new page after 5 secondes.

  36. Jeremie Tisseau says:

    4 Jun, 2008

    @ Allen: You should better ask Luca, the author of Formcheck2. But, he is a very busy man. I don’t know if he will have time to answer you.

    @ Justin: no idea. Do you work on your localhost? If so, do you use a software such as EasyPHP?…You should tell us a bit more about your problem if you want someone to be able to help you.

  37. Justin says:

    4 Jun, 2008

    I’m working off my localhost. The error says can’t find file at :

    .

    I just uploaded the files to my server and tried to use it, and this is the error I’m getting.

    Thanks for any advice.

  38. Jeremie Tisseau says:

    4 Jun, 2008

    Could you send us the URL? We don’t see your error message.

  39. Q8iEnG says:

    9 Jun, 2008

    Hi, thanks my friend for the script I’ll use it in my other site
    http://www.clickclick.ws

    i’ll release soon the new design of it..

    have a good day :)

  40. Q8iEnG says:

    9 Jun, 2008

    I tried it,, but it give me an error message for failed sending :(

    check it here
    http://clickclick.ws/LightForm/index.php

    please reply to my email :)

  41. Jeremie Tisseau says:

    9 Jun, 2008

    This looks like you don’t have a SMTP server installed on your server? You will have to check this with your web hosting company.

    In any case I don’t think it is a problem related to my contact form unless you have screwed up the code. :)

  42. Q8iEnG says:

    10 Jun, 2008

    I didn’t use any of the code!

    just installed it in the site and it is not working!

  43. Jeremie Tisseau says:

    10 Jun, 2008

    So did you check if you have an SMTP server?

  44. Q8iEnG says:

    10 Jun, 2008

    I don’t think that it is from the SMTP!!

    because i’m using a script (contact form), that’s work just fine without any problem

    this is it
    http://www.q8ieng.net/mailform/mailform.php

    I’ll contact my support and i’ll let you know :)

  45. Jeremie Tisseau says:

    10 Jun, 2008

    Then, I really don’t know. Many people have downloaded this script and no one reported a similar problem. Besides, I have tested this script many times and it works just fine.

  46. Q8iEnG says:

    10 Jun, 2008

    they told me
    Yes, of course. We have SMTP server (EXIM) running on all our hosting servers!!

    so, where did u think the problem is?

  47. spfc says:

    18 Jun, 2008

    I am getting the following errors:

    Notice: Undefined index: name in D:\Sites\www.mydomain.com\form\index.php on line 12

    Notice: Undefined index: email in D:\Sites\www.mydomain.com\form\index.php on line 13

    Notice: Undefined index: website in D:\Sites\\www.mydomain.com\form\index.php on line 14

    Notice: Undefined index: subject in D:\Sites\\www.mydomain.com\form\index.php on line 18

    Notice: Undefined index: message in D:\Sites\\www.mydomain.com\form\index.php on line 27

    Can anyone help me? I didn’t touch anything from the code, just change the email address

  48. Q8iEnG says:

    19 Jun, 2008

    Thanks Jeeremine, I’ll try it :)

  49. Q8iEnG says:

    25 Jun, 2008

    Actually, I did everything, and everything is going alright

    except for the LightForm, I didn’t got how to place that script in it :\

  50. Meandme says:

    12 Jul, 2008

    Great ! But there is a problem with IE explorer 7, when i fill a box, the background image is leaving… just test… if you have a css solution for this, thanks a lot !
    Best regards !

  51. Jeremie Tisseau says:

    12 Jul, 2008

    Hello Meandme,

    It works fine for me in IE7. Has someone noticed the same bug in IE7?

  52. dosntMatter says:

    12 Jul, 2008

    Hi Jeremie Tisseau :)

    i said before: it works really great but if you disable Javascript, you can do what you want – also sending nothing – it comes the “congratulations Site.
    I have a idea:
    in your example fom lightscript use the tag
    and give a hint that they must activate Javascript
    Else it dont run/work

    If you have a better idea – go ahead

    Greets
    :)

  53. Xdiz says:

    13 Jul, 2008

    Thx very much for this work

  54. dosntMatter says:

    14 Jul, 2008

    Hi Jeremie Tisseau

    Here i am again – sorry for double-Posting – sorry for my bad english!

    “in your example fom lightscript use the tag
    and give a hint that they must activate Javascript
    Else it dont run/work”
    in your example from lightscript use the “NOSCRIPT” TAG.

    And: THX for that nice work !!

  55. Jeremie Tisseau says:

    15 Jul, 2008

    Hello dosntMatter,

    Actually your comment was posted but when I redesigned this site, I had to move things around and unfortunately, I lost the latest comments and yours as well. Sorry for that.

    I will think about this feature for LightForm but not right now. As you can see, this site is not quite finished yet.

    Thanks anyway for your comment. :)

  56. Roland says:

    18 Jul, 2008

    Hi, i get this IE7 Browser error message in german after sending the form:

    Line: 191
    Sign: 2
    Error: Object necessarily

    After i delete the complete Line 191 in the index.php the error-message was the same. Is there a javascript error?

    Thanks a lot!

  57. Jason Denison says:

    20 Jul, 2008

    Hey Jeremie Tisseau,

    Just wanted to say that I’ve searched the web for a very slick looking Contact Us Form that used some PHP, AJAX and JavaScript and your form by leeps and bounds is better than anything I’ve come across. It is freakn’ AWESOME!!! I haven’t installed it yet =) But saw the Demo and looked over the code. So intense!!

    Also thanks for being so detailed and actually taking the time to add comments in. Makes things so MUCH easier on newbies.

    THANKS!!!!!!
    jason

  58. flashios09 says:

    6 Aug, 2008

    Hey Jeremie Tisseau,
    your forms works with textinput and textarea but not with select,
    The alert box doesn’t appear when i add a

    Please choose
    Under 10
    Between 10 and 21
    Over 21

    i mean the script doesn’t validate it(select)
    can you help me,
    thanks very much for your work.

  59. flashios09 says:

    6 Aug, 2008

    I’m sorry, i forget to add for the XHTML code
    Hey Jeremie Tisseau,
    your forms works with textinput and textarea but not with select,
    The alert box doesn’t appear when i add a

    Please choose
    Under 10
    Between 10 and 21
    Over 21


    i mean the script doesn’t validate it(select) and i think the problem is ‘niceform.js’
    can you help me,
    thanks very much for your work.

  60. Jeremie Tisseau says:

    6 Aug, 2008

    Yes, I know. This form was not supposed to be anything else but a contact form.

    When I got some time, I will look into the code and see what I can do. In the meantime, you can visit FormCheck2 and read their documentation. His form validates <select>. I don’t think Niceform.js is the problem.

  61. flashios09 says:

    6 Aug, 2008

    first,thanks !!!!
    i know too,
    just want to say that when i remove the ligns of nices forms
    (i mean niceforms-default.css and niceforms.js)the alert box appear and the form will be validated and it work with ‘Select’ thats why i think nice form.js is the problem
    Note:the link of the documentation of formcheck2 doesn’t work(error 404)
    thanks Jeremie Tisseau

  62. Jeremie Tisseau says:

    6 Aug, 2008

    Thanks for the feedbacks!

    Do you mean the link I put in my latest comment? It works for me.

  63. ryan says:

    8 Aug, 2008

    mmartinovich Says:
    May 25th, 2008 at 6:29 pm

    Ok… i figuered out why it wouldnt want to send email…
    had to add this line before mail function:
    ini_set(”sendmail_from”, “postmaster@domain.com”);

    I’m having the same problem with 1&1 hosting, i keep getting the failed to send error message, yet i couldnt figure out where to put this code and it kept giving me syntax errors

  64. ryan says:

    8 Aug, 2008

    well, a step in the right direction was i got it to post, by replacing all the $_post with $_get. Now it just doesnt acutally post me anything entered in the fields haha

  65. Wifsimster says:

    12 Aug, 2008

    Bonjour,
    Voilà j’ai un petit problème de compréhension au niveau de la condition pour envoyer le message.
    A quoi correspond error-reporting ?

    else{
    error_reporting(0);

    if (mail($to, ...

    Merci d’avance ;)

  66. wifsimster says:

    12 Aug, 2008

    J’ai fais quelques recherches, c’est bon ça marche nickel chrome ;)

    • Yves says:

      30 Sep, 2010

      Bonjour

      Jai quelques soucis avec Chrome. le champ nom ne subit aucun controle
      voir mon post
      Auriez-vous une idée
      Merci

  67. Jeremie Tisseau says:

    12 Aug, 2008

    Cool!

  68. Dave says:

    13 Aug, 2008

    Hi Jeremie Tisseau,
    Thanks for this nice form.
    I’ve got a question. I was trying to setup this form on a website and want to test it with my email in it. Wich is not from the same domain. The website is for instance: http://www.mydomain.com and my email is… the one i filled in this form. When i send a test message, i don’t receive any email. When i put your form on my own domain. I do receive the message. Why is it not possible to use an email with a different domain in it?
    Or is it something else whats causing this issue?

    Hope to hear from you as im trying to get the website online by tomorrow :)

    Thanks,
    Dave.

  69. Dave says:

    13 Aug, 2008

    Ow… and yes… i also noticed in IE7 that when i type a large value of text in the message field, that the background is moving/scrolling up.

  70. Jeremie Tisseau says:

    13 Aug, 2008

    I have no idea Dave. You should contact your host. It might be a problem concerning your remote mail server and in that case, only them can help you.

    About the message you sent by mail:

    550-Response: 550-You do not have sufficient privileges 
    to send mail to this address.  Please
        550-550 authenticate and try again.
        550 Sender verify failed

    … here’s what I find on Google:

    This problem is caused in case your SMTP server doesn’t support sending of mails with local host identified as localhost.
    It requires, that computer, which is sending mail, has to be identified by real domain/host name.

    I don’t know if it helps.

  71. Jeremie Tisseau says:

    13 Aug, 2008

    Ow… and yes… i also noticed in IE7 that when i type a large value of text in the message field, that the background is moving/scrolling up.

    Open index.php and add the following conditional comment into the <head> section:

    ?View Code HTML4STRICT
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    
    <head>
    ...
    <!--[if IE]>
    <style type="text/css">
    /*<![CDATA[*/
    .textinput, .textinputHovered {
    	background-attachment: fixed;
    }
    /*]]>*/
    <![endif]-->
    </head>

    This code will be only be read by Internet explorer and will be ignored by other browsers.

  72. Dave says:

    13 Aug, 2008

    I had contact with the host company.
    They said, that the php script is using SMTP maling via PHP, wich is not allowed. Not to a remote domain, but only local. They advised me to change the script so it runs by ‘sendmail’ over PHP.
    The hosting company did this kinda protecting against spam by bots from the internet.

    Is it possible that you could change this? I really have no clue if it’s a lot of work. If it’s a lot of work for you, please contact me by mail. I would pay you for a sollution with this one.
    At the moment i havent found a decent mail script that works on this server.

    Thank you, please let me know.

    Dave

  73. Jeremie Tisseau says:

    13 Aug, 2008

    Dave, I can’t change the script in just five min. It is impossible. I would have to rewrite a good part of the code and I don’t have time for that. Read some documentation online about sendmail. I don’t think it would be very complicated to change code.

  74. Thiyagarajan.G says:

    29 Aug, 2008

    Thanks for this nice form. It is working very nice…

  75. Danielm says:

    3 Sep, 2008

    It doesn’t work togehter with mootools slimbox (http://www.digitalia.be/software/slimbox), because your lightform only uses the old version of mootools (current version is 1.2) :-(

  76. charlie says:

    12 Sep, 2008

    the first 4 fields won’t show up under IE7.
    anybody has this problem?

  77. denbagus says:

    14 Sep, 2008

    how change in Code Igniter Framework environment ?

  78. denbagus says:

    14 Sep, 2008

    and how to make random question every refresh the page ?
    so not only “2+3″ but can make another “2+3″

  79. Justin Fleming says:

    14 Sep, 2008

    Problem with the error popups is that they get their location from the size/layout of the form.

    If you put the form inside a scrolling div (overflow:auto), the error messages appear in the wrong place, since they appear where the input boxes *were* on page load before scrolling.

    Any fix for this? Thanks.

  80. Justin Fleming says:

    14 Sep, 2008

    Oh and yes, doesn’t work under IE7 (first 3 fields are not styled – input boxes are there and function, but are invisible and without graphics)

  81. kixass says:

    19 Sep, 2008

    for a fucking contact form you need 3 directories and fucking 100 files + housewife mootools. FTS everbody who is using this is a girl. inability. gayness.

  82. Jeremie Tisseau says:

    19 Sep, 2008

    There’s no need to be rude Kixass. That was just an experiment I have done. If you think you can do better, then do it! We will all be glad to use your script then.

  83. ordersomabuyg says:

    21 Sep, 2008

    Wow Cool !
    Super Man
    Nice Site

  84. Q8iEnG says:

    25 Sep, 2008

    Hi Jeremie Tisseau, :)

    please I’m using this script it is awesome

    but there’s something if you could help me doing it, i’ll be more appreciated :)

    the anti-spam question, please can you give me edited code for CAPTCHA re-generating image, instead of the question for anti-spam?

    please, I do really receive more than 20 emails a day!

    let me know, i’ll be much more appreciated ^_^

    and yeah don’t care about KIXASS he’s really jealous :D *I guess*

    waiting you mate :)

  85. Jeremie Tisseau says:

    25 Sep, 2008

    I don’t have time to look into this. Try searching on google some captcha scripts. There’re tons of them out there.

  86. Q8iEnG says:

    25 Sep, 2008

    Ok mate sorry for disturbing

    as you like :)

  87. Q8iEnG says:

    28 Sep, 2008

    As an appreciation :)

    I did inserted the Captcha
    Demo:
    http://www.q8ieng.com/mailform/mailform.php

    if you want to put this modified version, here’s the link
    Download:
    http://www.2shared.com/file/4004921/1a25e5f8/mailform.html

    Enjoy ^_^

  88. Jeremie Tisseau says:

    28 Sep, 2008

    Thanks Q8iEnG! Very nice!

  89. Q8iEnG says:

    28 Sep, 2008

    No problem, this is the way how to thank you for the nice script ^_^

    have a great day

  90. Ricardo Patino says:

    30 Sep, 2008

    Very nice clean code and appearance.

    This is my wife’s site. We are just uploading content, soon will be ready to launch.

    Thought you would like to know that your form works beautifully in shadowbox – but you probably know that already.

    Your form is exactly what i was looking for.

    Thanks a million!

  91. Jeremie Tisseau says:

    30 Sep, 2008

    @Ricardo,

    Actually, I have never seen LightForm in a Lightbox clone. Looks really nice.

    Good luck with your site. It looks really good at the moment.

  92. Greg says:

    3 Oct, 2008

    Hi

    I am using the MooTools login form you made here (http://web-kreation.com/index.php/tutorials/nice-login-and-signup-panel-using-mootools-12/).

    On the same page I am also trying to implement this contact form, however..

    The javascript from this and the styles from this interfere with each other. The Javascript stops the login panel sliding up and down and the style changes the input form for the login panel.

    Any ideas? Please use my email address to reply. Thanks :)

  93. Greg says:

    3 Oct, 2008

    The form highlighting doesnt work in Internet Explorer either :(

  94. Jeremie Tisseau says:

    4 Oct, 2008

    @Greg: Lightform works with Mootools 1.1 and the login panel with Mootools 1.2. That’s why the two scripts don’t work together.

    The form highlighting doesnt work in Internet Explorer either :(

    Yes, that is a known bug. I never had time to fix it. I will try to have a look at it asap.

  95. Greg says:

    4 Oct, 2008

    I managed to get the login panel and the lightform to work together by adding an iframe

  96. Ricardo Patino says:

    8 Oct, 2008

    Jeremy
    I need Help! The input fields in the contact form aren’t showing on ie7 – any idea? (they show fine on firefox)

  97. Greg says:

    8 Oct, 2008

    Did you just not read the 2 posts above you?

  98. Jeremie Tisseau says:

    9 Oct, 2008

    Ricardo, I have fixed it. It now works in IE6+. I only had to removed the code below line 118 in index.php to make it work properly:

    1
    2
    3
    4
    5
    6
    7
    8
    
    <!--[if IE]>
    <style type="text/css">
    /*<![CDATA[*/
    .textinput, .textinputHovered {
    	background-attachment: fixed;
    }
    /*]]>*/
    <![endif]-->

    However, I have improved LightForm a little bit and updated it with the Niceform v1.0 so it is better if you download the new version (v1.1) in the post above. Cheers!

  99. Jacob says:

    14 Oct, 2008

    Hi! I am having some problems to get it working properly. It works until I press the send button, then I only get a 404 with this added in the url:

    Any suggestions? :)

  100. Jacob says:

    14 Oct, 2008

    missed to input the code:

  101. Kiz Oyunlari says:

    26 Oct, 2008

    Thanks. Good job.

  102. Silent Radar says:

    29 Oct, 2008

    I installed the form and it work but there major issues with images. I don’t get the rounded corners and it makes the boxes look like the ends are missing. Also the js somehow killed my jquery nav bar. Maybe I have the js in the wrong places and that is causing the problem. The js I can sort out later but right now I am concered about the images looking right.

    Thanks for any help

  103. Jeremie Tisseau says:

    29 Oct, 2008

    jQuery and Mootools are two different JS frameworks and can’t work together on the same Web page. You have to choose one or the other.

  104. Sean says:

    11 Nov, 2008

    how do i remove the “Website” form and add a text field for “Phone number”? or simply change it to that? – Sorry, new to php.

  105. Jeremie Tisseau says:

    11 Nov, 2008

    Open index.php and go to line 61:

    1
    
    $website = stripslashes($_POST['website']); //sender's website

    and modify the code as so:

    1
    
    $phone = stripslashes($_POST['phone']); //sender's phone number

    Now, go to line 73 and replace this line:

    1
    
    $msg .= "Website : $website \r\n";

    … by this one:

    1
    
    $msg .= "Phone Number : $phone \r\n";

    Go to line 138:

    ?View Code HTML4STRICT
    1
    2
    3
    
    <!-- Website -->
    <label for="site">Website : </label>
    <input id="website" name="website" type="text" class="validate['url']" size="20" />

    Modify it as shown below:

    ?View Code HTML4STRICT
    1
    2
    3
    
    <!-- Phone Number -->
    <label for="phone">Phone : </label>
    <input id="phone" name="phone" type="text" class="validate['required','number','length[3,-1]']" size="20" />

    You don’t need to put ‘required’ if this field is optional.

  106. Sean says:

    12 Nov, 2008

    thank you so much for your fast response.. its working great :)

  107. Sean says:

    12 Nov, 2008

    One more thing, I’m trying to change the “Thank you!” text on the message sent page along with the check mark color and the submit button color to green 62C14F so i can keep a consistent color pattern with the site I’m building. The rest of the text on the sent page white FFFFFF, and the white background behind it all to be black. I realize that a lot of this is editing the .gif files included, but when i try to do it in photoshop, they’re locked and will not let me edit or even unlock them. Maybe I’m missing something here… Sorry for the newb questions about this.

  108. padZtar says:

    19 Nov, 2008

    Hi Jeremie Tisseau,
    Id like to start by thanking you for compiling this Brilliant Contact form. It looks and works nicely.

    However, I am trying very hard to add some required text fields to the form which will then be carried through to the Email that is delivered. At the moment I have added all of the text fields that are required and have ammended the code as suggested, but simply cant work out how to get all of the fields to appear in the email that is sent??? Its driving me bonkers!!

    My testing page can be found HERE… Id be eternally greatful if you or somebody could take a look and let me know where im going wrong…

    Hope you can help,
    padz :)

  109. Jason says:

    20 Nov, 2008

    Like everyone else here, I love love love the script. THANK YOU!

    Quick question though: Is anyone having issues in Safari? I have it working just fine in IE and FF, but Safari just gives me the perpetual loading signal.

    Let me know if you need to see the code.

  110. ktsixit says:

    20 Nov, 2008

    nice script, but you should also have a clear css version for downloading. Without styling, images and css styles. Just the code people actually need. It takes a lot of time to make the changes I wnat, There’s no need to do all this.

  111. Jeremie Tisseau says:

    20 Nov, 2008

    Ktsixit, you got a good point. It is something I will try to keep in mind next time I update this script. Thanks!

  112. Rayinnyc says:

    22 Nov, 2008

    Nice form. I Want to add a selection box with different departments and different email addresses for each department which the user will pick. I’m new to php sorry! Any help would be appreciated.

  113. Billigflüge says:

    15 Dec, 2008

    Nice! I´ve got updatet the script, and it´s working beautifully!!!!
    Thx alot, greets

  114. Accelra says:

    16 Dec, 2008

    Hi there,

    I was wondering if anyone had the altered code that Q8iEnG did that put a Captcha into the form as his download link is offline?

    Any help would be much appreciated.

    Thanks

  115. Fabio says:

    18 Dec, 2008

    first of all, many, many, many thanks for this super useful implementation, and, quite obviously, a request: can you show me the code to insert a checkbox? i tried in many ways, but can’t get to make it work.
    again, mate, many thanks!

  116. byila says:

    26 Dec, 2008

    THANK YOU for this awesome contact form…

  117. pertrai1 says:

    30 Dec, 2008

    Could you give me a quick working example of how to use checkboxes with this please. Thank you.

  118. sama creation says:

    22 Jan, 2009

    hi
    tanks for the contact form
    i have a problem my Host server dont allow the funtion “mail”
    so i must use SMTP and enter my user and passe to make it woks

    can you give me a version Of light Form using SMTP tanks so much

  119. Oliver Melton says:

    27 Jan, 2009

    Anyway to execute this form without a de facto page refresh?

    I’m trying to embed it in a Spry panel, and everything works great except that when I click submit, it reload the page and sends the user back to the first tab.

    At the very least, it would be great if I could identify a specific tab (I can do this using a URL, ex. http://www.example.com/index.php?panel=5) to be shown after the script executes.

    Great form; any suggestions would be much appreciated.

  120. Oliver Melton says:

    27 Jan, 2009

    PS, the validation doesn’t seem to work when embedded in the panel either. Just FYI.

  121. Jeremie Tisseau says:

    27 Jan, 2009

    This can be done with AJAX. Nettuts has an excellent article on the subject but you will have to rewrite most of the script.

    Otherwise, it must be possible to identify a specific tab as you suggest but I have no idea how.

  122. Accelra says:

    28 Jan, 2009

    Hi there,

    Has anyone got a version of this form with a captcha code generator.

    Or has anyone got one the above with a captch set up.

    Cheers for any help.

  123. Oliver Melton says:

    30 Jan, 2009

    Here’s something I found that might do the trick. I’ve not had time to experiment yet, but I will.

    :: http://cates-associates.net/tutorials/Tutorial-CS3-forms.html

  124. Andrey says:

    1 Feb, 2009

    Hi Jeremie Tisseau! Tell to me how to make that after pressing “Send it” the message on successful sending on the same page where also the form emerged, instead of the new page opened. Thanks.

  125. Oliver Melton says:

    2 Feb, 2009

    @ Andrey

    I think that’s essentially my question as well.

  126. prawin says:

    5 Feb, 2009

    HI jeermie,
    Ihave tried ur coding,  But unfortunately it doesnt works , i got the error as
    Parse error: syntax error, unexpected T_IF in c:\wamp\www\prawin\new\ajax\new1\index.php on line 31

    ie is in index .php
    30.    <? php
    31.     if ($_SERVER['REQUEST_METHOD'] != ‘POST’){
    32      $self = $_SERVER['PHP_SELF'];
    33.     ?>
    kindly tell me where i went wrong

  127. Ella says:

    17 Feb, 2009

    The script works GREAT. Thank you so much! :)

  128. Ivonne says:

    18 Feb, 2009

    The script is perfect I updatet it and it is working perfect!!!!
    Thanks a lot!!!!

  129. Kral Oyun says:

    19 Mar, 2009

    Can someone tell me how I can redirect to a different page instead of going back to the source page?

  130. Pre says:

    24 Mar, 2009

    I’m having issues with the from. The text field bg image won’t display with the validate class. How do I correct this?

  131. Matt Rittman says:

    26 Mar, 2009

    Is it possible to use FormCheck on a regular PHP contact form?

  132. Jeremie Tisseau says:

    26 Mar, 2009

    Yes, you can. It is what I did to build LightForm. Check the official FormCheck page for usage.

  133. Matt Rittman says:

    26 Mar, 2009

    I’m still a bit confused on what MooTools is…

    I downloaded formcheck and put the .js files on my web server. Then I added the javascript code to the top of my php page. I added the class to one of the input boxes on my form but it didn’t do anything at all when I tested it out. Am I doing something wrong?

  134. Juju says:

    1 Apr, 2009

    Hello,
    Sorry, i’m french and i don’t speak english very well.

    I would like to know how to accept the accents in the form, because when I receive the email, I like this character “Ã ©”, “è” …

    Thanks a lot, this form is super !!

    Juju

    • Jeremie Tisseau says:

      1 Apr, 2009

      Pas de problème. You must change the charset in the <HEAD> section of your document:

      ?View Code HTML4STRICT
      1
      
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

      For french alphabet, I think you need to use charset=iso-8859-1 (Western Alphabet ) if I remember well. If it doesn’t work, have a loot at this list. charset=iso-8859-2 should work as well.

  135. Juju says:

    2 Apr, 2009

    Sorry it’s ok.
    Problem was that i used joomla ;)

    Thank you very much ;)

  136. Rock7 says:

    19 Apr, 2009

    I’ve installed the code into an existing contact us page. Everything works fine except the Tipbox’s are appearing in my page background and are getting cut off by the page body.

  137. Marco van Dam says:

    20 Apr, 2009

    Hello,

    The lightform script is really great!!!

    But i have still one question…

    How can i mail the form as a HTML mail?
    I tryd, but can’t get it too work…

    Hope you can help me :-)

  138. Marco van Dam says:

    21 Apr, 2009

    This form is super!!

    But the form send the information in plain text, can i send the form info also in html mail?

  139. Yves says:

    30 Sep, 2010

    Hello,
    I’m trying your form
    Wonderful job

    I’va a problem with Chrome, the control of area field works, but the control on name doesn’t work no error message

    Has any one an idea

    THANKS , MErci d’avance

  140. darius says:

    30 Sep, 2010

    Hi, great form! i wanted to ask why when i add a dropdown menu to the form, it breaks the style to the form meaning the rounded corners. i dont need to validate the dropdown menu, its just an option. Any help will suffice. thanks!

  141. Ravvir says:

    8 Oct, 2010

    Hello!!
    I have one problem to fix:
    There’s button “contact” on the main page of my site.
    By clicking the button with code:
    “”"Contact
    this contact form is loaded to div called “content” using code :

    “”"
    file contact.php and all the other like news.php etc are at the main location with index.php
    to file contact.php i’m including this contact form from location /contact/index.php
    using code:
    “”"”"”

    all form files are on the main server location inside folder “contact”.(eg. files *.js are in /contact/js/,
    *.css are in /contact/css/ all images in /contact/images/.

    when I try to send mail (defined properly as “$to = ‘me@domain.com’;”) it just not send it and redirecting me to the first page of my site news.php.

    Does anyone know how to fix it ?

  142. Alexander says:

    12 Oct, 2010

    Hello Jeremie,

    I’m currently using your form, but i still can’t use checkbox and select. Please give me the example class how to use it. I still can’t use those class for checkbox and select. Thanks in advance.

    • Jeeremie says:

      17 Oct, 2010

      … because I didn’t implement them. That’s why you can’t use them. Lightform is not supported anymore. It is said on top of this page.

      • Alexander says:

        18 Oct, 2010

        Hiks, Why doesn’t support anymore because it’s so powerful and truly light. Can you please just fix the checkbox and select. Thanks in advance.

  143. timebombtimmy says:

    11 Nov, 2010

    If you are having trouble sending out email, and have a SMTP server available elsewhere, try adding the following to the script so it looks like below. You will need to change the entries to match your setup.

    //IMPORTANT!!

    //Server info
    $mail_ini=ini_set(SMTP,”mail.yourdomain.com”);
    $mail_ini=ini_set(smtp_port,25);
    ini_set(‘sendmail_from’, ‘validemail@yourdomain.com’);

    //Put in your email address below:
    $to = ‘youremail@yourdomain.com’;

    FYI: This is provided as-is. I will not respond to questions regarding this comment.

  144. Jhay says:

    18 Nov, 2010

    How can i remove the security question (“are you human?”) feature from the script? I would like to use only a plain form without security.

  145. Jhay says:

    18 Nov, 2010

    I tried removing the lines for the security question from the index.php file but i would always get an error when i send the message.

  146. negative says:

    20 Nov, 2010

    I’m having issues with the form
    when i submit this form, following message si show:

    Congratulations!!
    Thank you , your message is sent!
    I will get back to you as soon as possible.

    but i do not receive an email
    please help me

  147. Gabriel Bedon says:

    19 Jan, 2011

    I encountred the fix to resolve the selects, add this parameter in select code: class=”width_200″

    Example:

    1
    2
    3

  148. akber says:

    24 Jan, 2011

    Hi,

    many thanks for your kind support giving us this script. i have a question,

    how can i add a bcc with this script, will you please help me?

  149. bobby b says:

    7 Feb, 2011

    how can I have more than one form on the same page?

  150. Hugo Moutinho says:

    19 Feb, 2011

    Hi,

    Regarding the SMTP validation, arent we supposed to put in the password as well? I dont see the field for it as someone gave this code in one reply:

    //IMPORTANT!!

    //Server info
    $mail_ini=ini_set(SMTP,”mail.yourdomain.com”);
    $mail_ini=ini_set(smtp_port,25);
    ini_set(‘sendmail_from’, ‘validemail@yourdomain.com’);

    //Put in your email address below:
    $to = ‘youremail@yourdomain.com’;

  151. xodhaz designz says:

    1 Mar, 2011

    nice..thanx..Used this on my website…www.jhazzie.com

  152. Antony says:

    2 Jun, 2011

    Its suitable for Google Chrome? how can we integrate this for multiple forms in single html page?

    • Jeeremie says:

      6 Jun, 2011

      Yes, it is PHP, which is a server-side programming language. It will work in any browsers. You should be able to have this form multiple times on this page but you will have to change the variable names and the ID of the form.

  153. Matko says:

    6 Jun, 2011

    Super script. How to work in utf-8. When I receive email I get a message in this: žžlžđkšš Can you help me.

  154. Dave says:

    9 Jun, 2011

    Hey M8, im trying to change the website for Phone instead, id like to validate the phone number then, any tips?.

    atm im changing all website for phone, then make it required for validation


    * Phone :

    what else is there

    • Dave says:

      9 Jun, 2011

      Hey jeremie, the form isnt validating the fields what happened to it?

  155. ale says:

    22 Jun, 2011

    Hi, is not working fine in chrome. The first fields are not validating. Any solution?
    Thanks.

    • Jeeremie says:

      23 Jun, 2011

      This script is no longer supported any longer. This is an old script created when Chrome didn’t exist yet.

Leave a Reply

Sorry, comments are closed