Go Back   Dreamweaver Club Forums > Hand Coders Forum > Javascript and JS frameworks
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 07-25-2009, 11:43 AM   #1
Join Date: Feb 2009
Posts: 129
Unhappy Form Validation

I have the following form:

HTML Code:
<form method="post" action="post.php" name="update" style="height:280px; width:auto;">
          <br />
          <div id="box">
            <textarea name="story" onclick="if(this.value == 'Input Story Here . . .'){this.value = ''};" style="width:545px; height:104px; font:'Segoe UI'">Input Story Here . . .</textarea>
          <div id="line">
        <input type="text" name="first" value="First Name" style="color:#666666;" onclick="if(this.value == 'First Name'){this.value = ''};" align="middle" />
        <input type="text" name="last" value="Last Name" style="color:#666666;" onclick="if(this.value == 'Last Name'){this.value = ''};" align="middle" />
        <input type="text" name="email" value="Email" style="color:#666666;" onclick="if(this.value == 'Email'){this.value = ''};" align="middle" />
        <select name="category" title="category" style="color:#666666;" align="middle" >
          <option value="choose" selected>Please Select...</option>
          <option value="home">Home</option>
          <option value="work">Work</option>
          <option value="family">Family</option>
          <option value="friends">Friends</option>
          <option value="strangers">Strangers</option>
          <option value="transport">Transport</option>
        <img src="images/spacer.png" height="1" width="5" />
        <input type="image" src="images/go.png" name="submit" align="middle" />
I need to make a simple javascript function (that goes between the 'head' tags) that validates the above form so that if the value of each input field equals nothing or its own text then an error pops up and they have to refill in the form, also if the pull down box's value equals 'Please Select . . .' then this will also happen again.

I have no idea what to do, could someone provide a working script, i am confuzzled

thanks Adam_C
Adam_C is offline   Reply With Quote

Thread Tools
Display Modes

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

Forum Jump

All times are GMT. The time now is 03:34 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com