Combo box Validation Problem

Hi, I’m having a strange problem with the validation of a combo box on a form which is viewed on the web.

Simple Combo-box with the formula (for values):

“”:@If(Decision = “Rework” | Decision = “Reject and Replace” | Decision = “”;“”;@DbLookup(“”;“”;“TechState”;Decision;2))

So i then use Javascript to do validation - make sure its not missed out…

if (doc.Decision[1].checked == true && doc.TechJust.value == “”)

{

alert("Technical Justification needs to be filled out\nbefore Engineering is marked as Complete.");

return false;

}

The problem is…I get the error message when i dont fill it in…thats fair enough, but when i put in a value…it STILL prompts me for a value…Am I missing something here?

Thanks for any help

F1H

Subject: Combo box Validation Problem

try this…

var doc = document.forms[0];

var TechJust = doc.TestJust.value;

if (!(doc.Decision[0].checked==false) &&

 (TechJust==""))

{

window.alert(“Technical Justification needs to be filled out before Engineering is marked as Complete.”);

document.forms[0].TechJust.focus();

}

jason

Subject: Combo box Validation Problem

Try the following and see if it works. I’m referencing the selected value and checking to see if the value equals the right thing. I’m not sure if the checked property will work with a combobox, but is should work with a radio and check box.

frm = document.forms[o];

var comboBoxValue = frm.comboBox.options[frm.comboBox.selectedIndex].text

if(comboBoxValue == “Select”){

alert(“Please select a value.”)

frm.comboBox.focus()

return false

} //end if