SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
May 5, 2005, 08:28 #1
- Join Date
- Nov 2004
- Location
- griffith
- Posts
- 72
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
How to Hide form field based on dropdown choice
Dropdown has three choices. If the third is chosen, the next field needs to be hidden. is there an ASP version of a show/hide script?
-
May 5, 2005, 11:00 #2
- Join Date
- May 2005
- Location
- Ohio
- Posts
- 16
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Note that I don't know much, but I'd imagine it'd be similar to
Code:<% strWhatever = Replace(Request.Form("nameofdropdown"), "'", "''") If strWhatever = OptionFromDropDown then %> <!--#include file='includes/adminmenu.inc'--> <% Else %> <!--#include file='includes/usersmenu.inc'--> <% End If %>
-
May 5, 2005, 15:11 #3
- Join Date
- Oct 2000
- Location
- Philadelphia, PA
- Posts
- 4,708
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Looks good to me Strypes.
Keep in mind this is considering you are posting the form. If you want something client side then search for a JavaScript solution."Does this napkin smell like chloroform?"
...now with SnapFoo!
My Blog | My Twitter | My Company | SitePoint Podcast
*** Matt Mullenweg on the SitePoint Podcast ***
-
May 10, 2005, 06:20 #4
- Join Date
- May 2003
- Location
- Houston, TX
- Posts
- 138
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
yeah that would cause a page have to reload. Javascript forum would be best. I would stick the form element in a <div> and set the style to 'none' with an onchange event of the dropdown.
I think sometimes I dream in code.
-
May 10, 2005, 06:57 #5
- Join Date
- Jul 2001
- Location
- Scotland
- Posts
- 4,836
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Just to be a pain, instead of using:
Code:<% strWhatever = Replace(Request.Form("nameofdropdown"), "'", "''") If strWhatever = OptionFromDropDown then %> <!--#include file='includes/adminmenu.inc'--> <% Else %> <!--#include file='includes/usersmenu.inc'--> <% End If %>
Code:<% strWhatever = Replace(Request.Form("nameofdropdown"), "'", "''") If ( strWhatever = OptionFromDropDown ) then Server.Execute("includes/adminmenu.inc") Else Server.Execute("includes/usersmenu.inc") End If %>
Bookmarks