Hi
I`m trying to create a dropdown which if the value "for sale" is selected a text box appears to ask for the asking price, if any other value is selected the text box stays hidden. Can anyone help with this?
Many thanks
Lee
Javascript
Moderator: General Moderators
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
-
asgerhallas
- Forum Commoner
- Posts: 80
- Joined: Tue Mar 14, 2006 11:11 am
- Location: Århus, Denmark
feyd | Please use
on the select tag try something like this:
onchange="ShowHide()"
... untested...
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Something like this:
[syntax="javascript"]function ShowHide()
{
obj=document.getElementById('IDOfElementToShowOrHide');
if (obj.style.display=='none') obj.style.display='show';
else obj.style.display='hide';
}onchange="ShowHide()"
... untested...
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]