Web Design and Development Forums

Show/Hide text fields based on drop down

This is a discussion on "Show/Hide text fields based on drop down" within the JavaScript Forum section. This forum, and the thread "Show/Hide text fields based on drop down are both part of the Program Your Website category.


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

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Apr 22nd, 2008, 11:06   #1 (permalink)
Up'n'Coming Member
 
Join Date: Jan 2006
Location: Belfast
Posts: 57
Show/Hide text fields based on drop down

Hi,

I am working on a form with a drop down option:
Have you posted before? "Please Select", "Yes", "No"

If the user selects No, then I want 3 text fields to show
- Text field 1
- Text field 2
- Text field 3

If the user selects Yes, then the 3 text fields don't show!

Can anyone help me with the coding for this? My knowledge is fairly basic and I have tried googling for an answer, without success!

Many thanks

Ben
sing2trees 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 Apr 22nd, 2008, 21:01   #2 (permalink)
Nerdy Moderator
 
CloudedVision's Avatar
 
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 520
Blog Entries: 4
Re: Show/Hide text fields based on drop down

You can use something like this:

Code: Select all
<select id="myselect" name="myselect" onchange="if(this.selectedIndex==1) { /* Do something */ } else { /* do something else */ }">
<option>Option</option>
<option>Option</option>
<option>Option</option>
</select>
__________________
Take it easy

Other Road Design

WebForumz Moderator: HTML | Javascript | PHP
CloudedVision 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

Thread Tools
Rate This Thread
Rate This Thread:

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
text based slide show skat ASP.NET Forum 4 Apr 7th, 2008 22:23
CSS Show Hide with JS abis123 JavaScript Forum 4 Dec 13th, 2007 05:39
Show/Hide JS pa007 JavaScript Forum 0 Apr 6th, 2007 19:18
Show and Hide Text - how do I do that? Love2Java JavaScript Forum 1 Mar 29th, 2007 00:23
Show/Hide Div Help Trebz JavaScript Forum 2 Feb 21st, 2006 22:37



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 19:07.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59