SunQuest
           Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old May 13th, 2003, 08:13 PM
Arc Arc is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 Arc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Showing a textbox with an onchange event


Hi, I have a listbox that has 2 values Current Images and New Images. I want to be able to have a textbox show on the page when New Images is selected and have it disapear when the other is selected.

I know this is javascript and i know basically how to do it but i dont know how to get a textbox to show or hide. Here's what i have.
php Code:
Original - php Code
  1.  
  2. <select name="select" onchange="GetValue(list)">
  3.                   <option selected>Current Images</option>
  4.                   <option>New Images</option>
  5.                 </select></td>
  6.                 <script language="javascript">
  7.                 function GetValue(aList){
  8.                 var ListValue = aList.options[aList.selectedindex].text
  9.                 If (ListValue = "New Image"){
  10.                 <br> show text box
  11.                 }else{
  12.                 hide text box
  13.                 }
  14.                 }
  15.                 </script>
  16.  


Any help is appreciated!

Reply With Quote
  #2  
Old May 13th, 2003, 10:35 PM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Showing a textbox with an onchange event

suppose we have a textbox, and we put it in a hidden layer:

<div id="theLayer" style="display:none">
<input type="text" name="someTextbox" />
</div>

now, we can use this to show the textbox by making the layer visible:

document.getElementById('theLayer').style.display = 'block';

and this to hide it again:

document.getElementById('theLayer').style.display = 'none';

I could also have used the visibility: hidden/visible option, but that will cause the hidden element to take up space even when it is hidden.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Showing a textbox with an onchange event


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway