+ Reply to Thread
Results 1 to 3 of 3

Thread: Exclamation How can I validate my contact form?

  1. #1
    ciril tomy's Avatar
    ciril tomy is offline x10Hosting Member ciril tomy is an unknown quantity at this point
    Join Date
    Jul 2009
    Location
    TOKYO, JAPAN
    Posts
    53

    Exclamation How can I validate my contact form?

    Hi Friends!

    Can anybody tell me hoe can I validate my contact form using java script?
    You can see my contact form http://www.webworld.x10hosting.com/contact.html
    is not working properly. I tried to validate it by javascript but it didn't work out...

    Please help me....
    Thanks in advanse.
    __________________

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Exclamation How can I validate my contact form?

    Well, where you attach your validation code here:

    Code:
    <input name="email" type="text" class="text" id="email" 
    onblur="MM_validateForm('name','','R','email','','RisEmail');
    return document.MM_returnValue" />
    so the only time the script checks the fields is when you leave the e-mail box.
    As long as you stay out of the e-mail box, the code never runs. Even if it does run,it does not keep the user from ignoring it and submitting the form anyway.

    If you want the validation to occur when the user tries to submit the form and you want the script to stop the form from being submitted if there are errors, you need to attach your validation script to to the onsubmit event handler of the form itself.

    Code:
    <form action="contact.php" method="post" 
    onSubmit=="MM_validateForm('name','','R','email','','RisEmail');
    return document.MM_returnValue"
    enctype="application/x-www-form-urlencoded">
    The "return document.MM_returnValue" will keep the form from being submitted if there are errors on the page.

    Remember that the user can turn off JS, etc, so you should never trust this type of validation. You have to check the input again in the server script that handles the submission. JS validation helps remind users to properly fill out a form, but it is lousy security.

    Note:
    remember that 'hidden' fields are not secure.
    Code:
    <input name="hiddenField" type="hidden" id="hiddenField" value="mailto:ciril_sep17@hotmail.com" />
    PS: The highlighting of the input boxes using mouseover is not done well. Highlighting the name input box shifts all the other boxes down and looks amateurish.
    Last edited by descalzo; 08-11-2009 at 10:44 AM.
    Nothing is always absolutely so.

  3. #3
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    Re: Exclamation How can I validate my contact form?

    Dreamweaver is a very popular WYSIWYG, but it will never allow you to fine tune your website as much as coding by hand. For the validation, I'd recommend a little JS snippet that will help you add validation to your form. It's called JavaScript Form Validation and it's available at JavaScript-Coder.com.
    And for your website, you should, in the menu, change either the color of the mouseover image or the color of the text when the mouse goes over it as it is pretty harsh on the eyes. Oh and your porfolio's images slide in and out a bit too fast. Try adding a little pause between the slide in and out, or make the movement slower.
    Last edited by xav0989; 08-13-2009 at 05:16 PM.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

+ Reply to Thread

Similar Threads

  1. How can I validate my contact form?
    By ciril tomy in forum Review My Site
    Replies: 1
    Last Post: 08-11-2009, 10:19 AM
  2. PHP contact form help...
    By rufussweetwater in forum Programming Help
    Replies: 1
    Last Post: 08-03-2009, 11:31 AM
  3. [5$]Get the Flash contact us Form
    By agroup in forum Ads & Offers
    Replies: 3
    Last Post: 12-18-2008, 09:30 AM
  4. Get Flash contact us Form
    By agroup in forum Ads & Offers
    Replies: 1
    Last Post: 12-17-2008, 09:36 AM
  5. PHP contact form styling (line spacing)
    By xxll_martin_llxx in forum Programming Help
    Replies: 3
    Last Post: 07-24-2008, 10:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers