I have a form that I want to pop up an alert message is someone selects the letter "A" from my select menu. I tried all different stuff and cant get the alert message to pop up when "A" is selected. I tried :
if(document.myform.myvalue.value = "A")
and it popped up alert message on all selections.
Here is the whole form part where I tried:
function check()
{
if(document.myform.myvalue.value == "A")
{
alert("Dont select the letter A")
return false
}
<cfform name="myform" action="dosomething.cfm" onSubmit="return check();">
<select name="myvalue" size="1">
<option value=http://www.webdeveloper.com/forum/archive/index.php/"A" selected>A</option>
<option value="b">b</option>
<option value="c">c</option>
</select>
if(document.myform.myvalue.value = "A")
and it popped up alert message on all selections.
Here is the whole form part where I tried:
function check()
{
if(document.myform.myvalue.value == "A")
{
alert("Dont select the letter A")
return false
}
<cfform name="myform" action="dosomething.cfm" onSubmit="return check();">
<select name="myvalue" size="1">
<option value=http://www.webdeveloper.com/forum/archive/index.php/"A" selected>A</option>
<option value="b">b</option>
<option value="c">c</option>
</select>