Forum Moderators: open
Will appreciate any help.
<script language="Javascript/text">
function checkForm(myForm)
{
var thisForm = myForm;
If (thisForm.selectBooks.value=="")
{
return();
}
else
thisForm.submit();
}
</script>
//error is here It says object expected?
<FORM name="AABooks" method="post" action="sell_Books.php;">
<p>
<SELECT name="selectBooks" onChange="checkForm(document.AABooks);" style="font-size='13px'; font-family='MS Sans Serif'; font-weight=500; font-style='Normal'; text-decoration='None'; width=">
<OPTION value="" SELECTED style="background-color='';color=''">Select
<OPTION value="">-----------------------------
thanks
Take a look at this page and see if this will do the trick - just cut and paste the whole thing, make an html page out of it and and view it in the browser. Is this what you are tying to achieve? I hope this helps.
Code from here on>>
<html>
<head>
<title></title>
<script language="javascript1.2" type="text/javascript">
function checkForm(){
field1=document.AABooks.product1;
field2=document.AABooks.product2;
if (field1.value=="" && field2.value==""){
alert("You have submitted an empty form. please make a selection");
return false;
}
}
</script>
</head>
<body>
<form name="AABooks" method="post" onsubmit="return checkForm()" action="sell_Books.php;">
<p>
Insert number of products required:
</p>
<p>
Select product number 1: <input type="text" name="product1" size="2" maxlength="2" value="">
</p>
<p>
Select product number 2: <input type="text" name="product2" size="2" maxlength="2" value="">
</p>
<input type="submit" value="Submit">
</form>
</body>
</html>