Hai everybody, this is the proplem.when i excute the page and on clicking the button am getting error message saying that 'menu1.value is null or not an object'. how can i handle it.Please help me

<SCRIPT type="text/javascript">

function test1(form) {
if (form.menu1.Value == "Select")
alert("Please select some other value!")
else {
alert("Hi "+form.menu1.value+"! Form input ok!");
}
}
</SCRIPT>
..
..
..(and in the <body>)
..
<h:selectOneMenu styleClass="selectOneMenu" id="menu1" value="Select">
    <f:selectItem itemValue="Select"  itemLabel="select"/>
    <f:selectItem itemValue="Value1" itemLabel="SAC" />
</h:selectOneMenu>
<TD><hx:commandExButton type="submit" value="Submit" styleClass="commandExButton"  id="button1" onclick="return test1(this.form);"></hx:commandExButton>

Edited 3 Years Ago by mike_2000_17: Fixed formatting

Well thats a typo mistake..
Anyhow i solved it. thanks for ur reply! i have done the changes i made .
<SCRIPT type="text/javascript">

function test1(frm) {
if (document.getElementById('Form1.menu1').Value == "Select")
alert("Please select some other value!")
else {
alert("Hi Form input ok!");
}
}
</SCRIPT>
..
..
..(and in the <body>)
..
<h:selectOneMenu styleClass="selectOneMenu" id="menu1" Value="Select">
<f:selectItem itemValue="Select" itemLabel="select"/>
<f:selectItem itemValue="Value1" itemLabel="SAC" />
</h:selectOneMenu>
<TD><hx:commandExButton type="submit" value="Submit" styleClass="commandExButton" id="button1" onclick="return test1(this);"></hx:commandExButton>

This question has already been answered. Start a new discussion instead.