if ( confirm("are you sure?") )
alert( 'you chose yes' );
else
alert("you chose no");
Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts
Thursday, July 31, 2008
Thursday, April 24, 2008
JavaScript: Drop Down Menus
In case you ever wondered how to do this here is an A List Apart article on how to do it very simply.
http://www.alistapart.com/articles/dropdowns
Please stop downloading really bad implementations and trying to hack them together. Just read this article (yes all of it) and then do it yourself. I promise you its not that hard.
*Takes your hand* Don't be scared. You'll be better for it I promise.
http://www.alistapart.com/articles/dropdowns
Please stop downloading really bad implementations and trying to hack them together. Just read this article (yes all of it) and then do it yourself. I promise you its not that hard.
*Takes your hand* Don't be scared. You'll be better for it I promise.
Monday, April 21, 2008
Javascript: Get a Value from a Drop Down Menu
To get the value:
To get the Option Name:
if you use prototype.js framework then you can replace the references to 'document.getElementById' with a $
document.getElementById( 'dropdownmenu_id' ).options[ document.getElementById('dropdownmenu_id').selectedIndex ].value
To get the Option Name:
document.getElementById('dropdownmenu_id').options[ document.getElementById('dropdownmenu_id').selectedIndex ].text
if you use prototype.js framework then you can replace the references to 'document.getElementById' with a $
Subscribe to:
Posts (Atom)