I am very new to Java Script and currently working on a program. Basically i am developing a pharmaceutical website. I have a php form with a drop down menu. The user selects a drug from the drop down menu to prescribe, then submits it. However, i need to try and validate this form with Javascript, and this is where my problem lies. Because i have echo'd out the list of all the drug id's,name and dosage, i dont know how to then validate each variable.

<form name="myform" action="<?php echo $pfile;?>" method="post" >
<input type="hidden" name="patientid" value="<?php echo $patientid;?>" />

PHP Code:
'SELECT * FROM `Drug` ';
$result mysql_query($sql);
    if (
mysql_num_rows($result) == 0)
" -- No patients found -- ";
    else {
"<select name=\"drugid\">/n";
"<option value=\"\"> </option>\n";
        while (
$r mysql_fetch_array($resultMYSQL_ASSOC))
"<option value=\"" $r['ref'] . "\">" $r['ref'] . " : " $r['name'] . " " $r['dose'] . "</option>\n";
<input type="submit" onclick="formvalidation('document.myform')" id="formbutton" value="Prescribe">


I then have tried to put Java Script into my header like so:

	function formvalidation() {
    // Fetch email-value
  dose = document.myform.dose.value ;
    // value empty?
    if (dose == "10mg")
            alert('That's a High Dosage');
            return false;

My JavaScript is just being ignored. Does anyone have any idea to validate for example, if the dose being submitted is 10mg, an alert will appear? Thanks in advance