Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Help on select tag


Message #1 by "Isaac Sogunro" <ilatine@h...> on Tue, 18 Dec 2001 09:44:32 -0500
not sure what you want to do with the number "6", etc., but 
document.write(colorChoice)  within your javascript will give you the array value of the item you choose in your list.

<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
function submitIt(carForm)
{
colorChoice = carform.color.selectedIndex

if (carForm.color.options[colorChoice].value == "")
{
alert("Your must pick a color")
return false
}
document.write(colorChoice)
return true
}
</SCRIPT>
----------------How can I extract just the number from the choice the user finally 
selects.
>ex:
>6 from 6-pink
>8 from 8-purple
>9 from 9-black


  Return to Index