Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Ezilon Directory   I Sell Pagerank   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 05-31-2007, 05:53 PM   #1 (permalink)
Inactive
 
petra036's Avatar
 
Join Date: 05-31-07
Location: Wellington, New Zealand
Posts: 5
iTrader: 0 / 0%
Latest Blog:
None

petra036 is liked by many
Question Drop-Down Area

I had a code for this along time ago, but seraching through, I have noticed I deleted it. I need it again for my website's Contact page. I need a code where there is a drop down menu, and if you select, something like "Report a bug" then a area will show up below it with text inside. Then you select "Cancel Account" and a new different area shows up. Anyone have any ideas? I have a picture attached of what I mean.
Attached Thumbnails
drop-down-area-reportbug.bmp  

Last edited by petra036 : 05-31-2007 at 05:55 PM. Reason: Adding Attachment
petra036 is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 06-01-2007, 12:14 AM   #2 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,968
iTrader: 0 / 0%
Latest Blog:
Ok, so we're back

Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
You can use XMLHttpRequest to do it.

**friendly thought
But what I don't like about the ^^ is that you have to wait untill all the content loads (I presume you know what XMLHttpRequest is).
So, if you have a lot of options in the DropDownList then you should reconsider using this technique.
At least I would.

hth.

Last edited by Costin Trifan : 06-01-2007 at 12:15 AM. Reason: formatting my text
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-01-2007, 10:30 AM   #3 (permalink)
Inactive
 
StupidScript's Avatar
 
Join Date: 09-22-06
Location: Los Angeles
Posts: 678
iTrader: 0 / 0%
Latest Blog:
None

StupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really nice
Also consider using the innerHTML attribute:
Code:
<script type='text/javascript'> var reportbug="Reporting a bug ... fill out this form: [bug form]"; var cancelacct="Cancelling account ... fill out this form: [cancel form]"; var pickit=new Array('',reportbug,cancelacct); var doing=new Array(0,'reportbug','cancelacct'); function setArea(choice) { area=document.getElementById('mainArea'); doit=document.getElementById('do'); if (choice!=0) { doit.value=doing[choice]; area.innerHTML=pickit[choice]; area.style.display='block'; } else { doit.value=''; area.style.display='none'; } } </script> <form> <input type='hidden' id='do' name='do' value='' /> <select id='choices' name='choices' onchange='setArea(this.options[this.selectedIndex].value)'> <option value=0 />Select... <option value=1 />Report a Bug <option value=2 />Cancel Account </select><br /> <div id='mainArea' style='width:400;height:300;display:none'></div> </form>
StupidScript is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-01-2007, 03:23 PM   #4 (permalink)
Inactive
 
petra036's Avatar
 
Join Date: 05-31-07
Location: Wellington, New Zealand
Posts: 5
iTrader: 0 / 0%
Latest Blog:
None

petra036 is liked by many
Cool Very good!

Quote:
Originally Posted by StupidScript View Post
Also consider using the innerHTML attribute:
Code:
<script type='text/javascript'> var reportbug="Reporting a bug ... fill out this form: [bug form]"; var cancelacct="Cancelling account ... fill out this form: [cancel form]"; var pickit=new Array('',reportbug,cancelacct); var doing=new Array(0,'reportbug','cancelacct'); function setArea(choice) { area=document.getElementById('mainArea'); doit=document.getElementById('do'); if (choice!=0) { doit.value=doing[choice]; area.innerHTML=pickit[choice]; area.style.display='block'; } else { doit.value=''; area.style.display='none'; } } </script> <form> <input type='hidden' id='do' name='do' value='' /> <select id='choices' name='choices' onchange='setArea(this.options[this.selectedIndex].value)'> <option value=0 />Select... <option value=1 />Report a Bug <option value=2 />Cancel Account </select><br /> <div id='mainArea' style='width:400;height:300;display:none'></div> </form>
Thankyou for this wonderful code. It works fine and I am sure it will be a hit on my Contact Page. Thankyou so much!
petra036 is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-01-2007, 04:26 PM   #5 (permalink)
Inactive
 
StupidScript's Avatar
 
Join Date: 09-22-06
Location: Los Angeles
Posts: 678
iTrader: 0 / 0%
Latest Blog:
None

StupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really nice
Welcome to the forums, petra036!

(I forgot the measurement value for the DIV stylesheet)
Code:
width:400px;height:300px;

Last edited by StupidScript : 06-01-2007 at 04:31 PM.
StupidScript is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-01-2007, 08:34 PM   #6 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,968
iTrader: 0 / 0%
Latest Blog:
Ok, so we're back

Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
Well done, James!

Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-01-2007, 10:23 PM   #7 (permalink)
Inactive
 
petra036's Avatar
 
Join Date: 05-31-07
Location: Wellington, New Zealand
Posts: 5
iTrader: 0 / 0%
Latest Blog:
None

petra036 is liked by many
Red face Thankyou

Quote:
Originally Posted by StupidScript View Post
Welcome to the forums, petra036
Why thankyou! it's always an honour to be part of the Internet's Scripting Team. It's really easy once you know how to script things!
petra036 is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

vB 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
member area djp_phillips Coding Forum 1 10-31-2007 04:49 AM
Members Area OzeTigerman Web Design Lobby 3 09-18-2007 06:34 AM
text area andybhoy Web Design Lobby 19 05-14-2007 02:14 AM
Members Area Pipeline-Webdesign Web Design Lobby 1 02-11-2004 02:44 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 09:09 PM.
© Copyright 2008 V7 Inc