Contact Form - Field Validation

Posted on 2009-02-09
Last Modified: 2012-05-06

I have created a contact form using HTML - I have validated the fields using the VALIDATION feature in Adobe Dreamweaver - but it doesn't appear to work.  The website seems to ignore the validation.  

I enclose the code below;-

Many thanks.


<legend>Contact Form</legend>

<p>* = Required Field</p>



  <br />

  <input name="Name" type="text" id="Name" onblur="MM_validateForm('Name','','R');return document.MM_returnValue" />

  <br />

<label>Email:*</label><br />

<input name="Email" type="text" id="Email" onblur="MM_validateForm('Email','','RisEmail');return document.MM_returnValue" />

<br />

<label>Telephone:</label><br />

<input name="Tele" type="text" id="Tele" onblur="MM_validateForm('Tele','','NisNum','Subject','','R','Message','','R');return document.MM_returnValue" />

<br />

<label>Website:</label><br />

<input name="Website" type="text" />

<br />



<legend>Contact Message</legend>


*<br />

<input name="Subject" type="text" id="Subject" />

<br />


*<br />

<textarea name="Message" cols="50" rows="10" id="Message"></textarea>



  <input type="submit" name="Submit" id="Submit" value="Submit" onblur="MM_validateForm('Name','','R','Email','','RisEmail','Tele','','NisNum','Subject','','R','Message','','R');return document.MM_returnValue"/>


Open in new window

Question by:SGARLINGE
    LVL 3

    Expert Comment

    Hey i see that you are calling javascript functions but i dont see any attached javascript functions to call. If this is the full document the reason it isnt working is because there are no functions to call.


    Author Comment

    Oh I see.  I just did what Adobe Dreamweaver said to do- which was click on my field, click on Validate form and select paramaters.  Surely it would insert the script if its a feature of the program.

    What script would I need ?
    LVL 3

    Accepted Solution

    Normally it would create a link to a java script file similar to this:
    <script type="text/javascript" src="./init.js"></script>

    or it will look like a big chunk of code like this:
    <script type="text/javascript" src="Site/javascript/ddaccordion.js">

    //lots of code would go in here

    LVL 3

    Expert Comment

    It should be in the original code or it is attached further up in your code. as i cannot see any opening html tags


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
    It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
    Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now