JavaScript

This is a discussion on "JavaScript" within the JavaScript Forum section. This forum, and the thread "JavaScript are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 20th, 2006, 15:15
Junior Member
Join Date: Jul 2006
Location: RamsLand
Age: 23
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
JavaScript

Hi All,

Please could anyone help me validating an Application Form using JavaScript?

Below is my code for the Form -

HTML: Select all
<form action='insertappform.php' method='post'>

        <tr>
             <td>Title:</td>
     <td><input type="text" name="tl"><br></td>
       </tr>
        <tr>
             <td>First Name:</td>
     <td><input type="text" name="ftn"><br></td>
       </tr>
       <tr>
             <td>Last Name:</td>
     <td><input type="text" name="ltn"><br></td>
       </tr>
<tr>
             <td>Date of Birth: </td>
             <td><input type="text" name="dob"><br></td>
       </tr>
        <tr>
             <td>Address 1:</td>
             <td><input type="text" name="a1"><br></td>
       </tr>
        <tr>
             <td>Address 2:</td> 
     <td><input type="text" name="a2"><br></td>
       </tr>
        <tr>
             <td>Town/City:</td> 
             <td><input type="text" name="tc"><br></td>
       </tr>
        <tr>
             <td>Postcode:</td> 
             <td><input type="text" name="psc"><br></td>
       </tr>
        <tr>
             <td>Phone:</td>
             <td><input type="text" name="phone"><br></td>
       </tr>
        <tr>
             <td>Email:</td> 
             <td><input type="text" name="email"><br></td>
       </tr>
        <tr>
             <td>Type of request:</td>
             <td><select name="typerequest">
         <option selected>Please Select
         <option>Equipment for home
        <option>Medical
         <option>Transport
                </select><br></td>
       </tr>
        <tr>
             <td>Amount of grant required:</td>
             <td><select name="grant">
         <option selected>Please Select
         <option>Up to - £1000
         <option>Up to - £3000
         <option>Up to - £5000
               </select><br></td>
       </tr>
        <tr>
            <td>Brief outline of disability:</td>
            <td><textarea name="outlinerequest"></textarea><br></td>
       </tr>
        <tr>
            <td>Details of request:</td> 
            <td><textarea name="detailsrequest"></textarea><br></td>
       </tr>
          </table>
        <tr>     

            <td><br><b>Section 2</b><br>Relationship to person/people above 
                <select name="relate">
        <option selected>Please Select
        <option>Carer
        <option>Friend
        <option>Therapist
                <option>Representative of institution
                <option>Other
              </select><br></td>
       </tr> 
        <tr>
         <table width="100%" height="270" border="1">
        <tr>
             <td>Title:</td>
     <td><input type="text" name="tl2"><br></td>
       </tr>
         <tr>
            <td><br>First Name:</td>
            <td><input type="text" name="ftn2"><br></td>
       </tr>
        <tr>
            <td>Last Name:</td>
    <td><input type="text" name="ltn2"><br></td>
       </tr>
        <tr>
            <td>Address 1:</td>
            <td><input type="text" name="a12"><br></td>
       </tr>
        <tr>
            <td>Address 2:</td>
            <td><input type="text" name="a22"><br></td>
       </tr> 
        <tr>
            <td>Town/City:</td>
            <td><input type="text" name="tc2"><br></td>
       </tr>
        <tr>
            <td>Postcode:</td>
            <td><input type="text" name="psc2"><br></td>
       </tr>
        <tr>
            <td>Phone:</td>
            <td><input type="text" name="phone2"><br></td>
       </tr>
        <tr>
            <td>Email:</td> 
            <td><input type="text" name="email2"><br></td>
       </tr>   
<tr>
   <td><input type="submit" value="Submit"></td>
        </tr>     
        </form>
Thanks
Reply With Quote

  #2 (permalink)  
Old Sep 20th, 2006, 17:35
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: JavaScript

For starters you need to decide which fields are mandatory.

You need to add an onsubmit='return(validate());' to the first line of your code where you start your form.

Then you need to write the validate function.

I hope you are not asking someone to write all the validation routines for you.
Reply With Quote
Reply

Tags
javascript

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
php and javascript yvettesio JavaScript Forum 8 Mar 14th, 2007 23:18
Javascript Help Daniel JavaScript Forum 5 Jan 4th, 2007 22:00
using xml in javascript shailu JavaScript Forum 0 Jul 25th, 2006 07:36
Can someone help me with this javascript Galaxyblue JavaScript Forum 2 Mar 11th, 2004 12:18
what does \\ mean in javascript jenjen1018 JavaScript Forum 5 Jan 6th, 2004 17:05


All times are GMT. The time now is 05:55.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43