a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Show/Hide input box

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Show/Hide input box
Page: [1]
 
dawnyy

 

Posts: 18
Joined: 6/15/2006
Status: offline

 
Show/Hide input box - 7/7/2006 9:42:51   
Can anyone tell me how I can update a page to show or hide an input box depening on the selected value of another input box?
Tailslide

 

Posts: 6367
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: online

 
RE: Show/Hide input box - 7/7/2006 12:57:22   
Have a look at this thread - you should be able to get it to do what you want.

http://www.frontpagewebmaster.com/m-283314/key-conditional/tm.htm#283579

_____________________________

Little Blue Plane Web Design | Land Rover project

:)

(in reply to dawnyy)
dawnyy

 

Posts: 18
Joined: 6/15/2006
Status: offline

 
RE: Show/Hide input box - 7/11/2006 10:18:21   
Thanks that was very useful, however I seem to have problem referring to the label to get that to hide too - can anyone help further?

(in reply to Tailslide)
Tailslide

 

Posts: 6367
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: online

 
RE: Show/Hide input box - 7/11/2006 11:03:44   
Post what you've got and it'll be easier to problem-solve it.

_____________________________

Little Blue Plane Web Design | Land Rover project

:)

(in reply to dawnyy)
dawnyy

 

Posts: 18
Joined: 6/15/2006
Status: offline

 
RE: Show/Hide input box - 7/11/2006 11:23:34   
I have this function running on the onchange event of a select list

function ShowEODC(mycombo){
var i = mycombo.selectedIndex

if (mycombo.selectedIndex == 0) {

document.getElementById('T-EODC').style.display = "block";
}

else {
document.getElementById('T-EODC').style.display = "none";
}
}

(in reply to Tailslide)
Tailslide

 

Posts: 6367
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: online

 
RE: Show/Hide input box - 7/11/2006 11:36:55   
can you post the markup for the relevant bit of form too?

If I remember rightly the label should be within the div that gets hidden/shown and so should be hidden or shown as required...

_____________________________

Little Blue Plane Web Design | Land Rover project

:)

(in reply to dawnyy)
dawnyy

 

Posts: 18
Joined: 6/15/2006
Status: offline

 
RE: Show/Hide input box - 7/11/2006 11:53:39   
Hasnt laid out very well. I don't have any DIV around this section, it seems to work without ???



<tr>
<td width=200px><label><font size=1 >Every other day collection (Y/N)</font></label></td>
<td width=43px>
<SELECT id="T-EOD" name="T-EOD" onchange="javascript:ShowEODC(this)">
<OPTION>Y
<OPTION SELECTED>N
</SELECT>
</td>
</tr>
<tr>
<td width=200px><label for="T-EODC" id="L-T-EODC" style="display:none"><font size=1 >For EODC collection which day (30/31 July)</font></label></td>
<td width=43px>
<SELECT id="T-EODC" name="T-EODC" style="display:none">
<OPTION SELECTED>30
<OPTION>31
</SELECT>
</script>
</td>
</tr>

(in reply to Tailslide)
Tailslide

 

Posts: 6367
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: online

 
RE: Show/Hide input box - 7/11/2006 12:07:55   
..apart from hiding the label that is :)

It will hide whatever has that particular ID - if you want the label gone too then the easiest way is to put the label within the area to be hidden i.e. stick it in a div and give the div the id T-EODC instead of the Select box.

_____________________________

Little Blue Plane Web Design | Land Rover project

:)

(in reply to dawnyy)
dawnyy

 

Posts: 18
Joined: 6/15/2006
Status: offline

 
RE: Show/Hide input box - 7/11/2006 12:13:11   
:) very funny lol

Not used DIV's much. Can this be done without using a stylesheet?

(in reply to Tailslide)
Tailslide

 

Posts: 6367
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: online

 
RE: Show/Hide input box - 7/11/2006 12:24:13   
In this case yes - you're basically just using the div to attach a label to the section you want to hide. The only styles involved are the display:block and display:none in the javascript bit.

_____________________________

Little Blue Plane Web Design | Land Rover project

:)

(in reply to dawnyy)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> General Web Development >> Show/Hide input box
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts