Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Reply
 
LinkBack Thread Tools
Old July 10th, 2009, 10:27 PM   #1
New Member
 

Join Date: Mar 2009
Location: NZ
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 namu is on a distinguished road
Question drop down menu validation JS

Greetings,

I have a form with a drop down menu, and I am able to put an alert message in if the user does not select one of the given options...however, when I submit the form ... all the rest of the form input is sent to my email, except for the option selected in the drop down menu

I am not sure where I am going wrong. Below is the JS code...(part of the form validation function)

Code:
  if(theForm.occasion.selectedIndex==0)
{
alert("Please select an Occasion.");
theForm.occasion.focus();
return (false);
}
where 'theForm' is the name of my form and 'occasion' is the select name for my drop down menu....see below for the code in the body section:

Code:
Occasion: 
<select name="occasion">
<option value selected>-- SELECT --</option>
<option value>Wedding</option>
<option value>Birthday</option>
<option value>Other</option>
</select>
Help would be appreciated in getting it to work...thank you
namu is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old July 10th, 2009, 11:44 PM   #2
New Member
 

Join Date: Mar 2009
Location: NZ
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 namu is on a distinguished road
Re: drop down menu validation JS

problem solved thanks...

i only needed <option>wedding</option> rather than <option value>...

namu is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
I have a normal css menu, but want ot add drop down menu to it multichild HTML, XHTML and CSS 7 January 9th, 2007 12:07 PM
Drop down menu ... Drysdale HTML, XHTML and CSS 3 July 21st, 2005 06:00 PM
Drop Menu Help xKillswitchx HTML, XHTML and CSS 1 July 13th, 2005 01:56 PM
help with drop menu makemesick JavaScript 8 April 25th, 2005 05:19 PM
Multiple Drop Down Validation Monie JavaScript 1 November 6th, 2004 03:41 AM


Search Engine Optimization by vBSEO 3.2.0 RC8