html and javscript problem

hi I have this code but when i run it it gives me run time error where i have defined the Form . It says Object expected.
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

dskaushikAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

russellshomeCommented:
You have a number of faults in your code. The one causing "object expected" error is caused by using language="Javascript/text".

Either use
<script type="text/javascript">

or
<script language="javascript">

Here is something that works (use indentation to reveal problems in your javascript code):

<script type="text/Javascript">
function checkForm(mySelector) {
     if (mySelector.value=="") {
          return;
     } else {
          mySelector.form.submit();
     }
}
</script>

<FORM name="AABooks" method="post" action="sell_Books.php">
<p>
<SELECT name="selectBooks" onChange="checkForm(this);" 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="">-----------------------------
<OPTION value="something">Submit the form
</SELECT>
</FORM>

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
umangjoshiCommented:
pls change this part

onChange="checkForm(document.AABooks);"

to

onChange="checkForm(AABooks);"
0
vitanzaCommented:
here is another problem - on this line:

<FORM name="AABooks" method="post" action="sell_Books.php;">

you should get rid of the semicolon after "sell_Books.php"
because you have the semicolon, the browser thinks sell_Books.php is javascript code
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

COBOLdinosaurCommented:
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

<note>
Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
</note>

If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp


Cd&

0
russellshomeCommented:
Recommendation: Points to me. I have answered by pointing out the cause of the error AND providing an alternative.
0
COBOLdinosaurCommented:
It is time to clean this abandoned question up.

I am putting it on a clean up list for CS.

<recommendation>
pointst to russellshome

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.