SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: combo box items

  1. #1
    SitePoint Addict AHMED's Avatar
    Join Date
    Oct 2002
    Location
    Egypt
    Posts
    399
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    combo box items

    when i use some compo box i can do something when it is changed like this

    Code:
    <SELECT onchange="do something here"  size=1  name=country>
    so can i do something when a specific item in the compo box is selected ??

    or how can i make some function to ckeck if the specific item is selected or not when i use onchange with the compo box ??

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2002
    Location
    Fort Lauderdale
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, here is some code
    Code:
    <script>
    			function checkCombo() {
    				if (document.frm.sel.value == "two")
    					alert("item two selected");
    			}
    </script>
    Code:
    <form name=frm>
    			<select name=sel onChange="checkCombo();">
    				<option value="one" selected>One
    				<option value="two">Two
    				<option value="three">Three
    			</select>
    </form>

    www.unpossiblemedia.com - A Fort Lauderdale based multimedia company.

  3. #3
    SitePoint Addict AHMED's Avatar
    Join Date
    Oct 2002
    Location
    Egypt
    Posts
    399
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh thx alot


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •