473,320 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Object expected question

Hi,
I'm a beginner with JavaScript and i can't figure out why i get this error: "Object Expected". I have the following code:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <SCRIPT language="Javascript" type=”text/javascript”>
  4. function adunare(){
  5. alert('please work');
  6. }
  7. </SCRIPT>
  8. </head>
  9. <body>
  10. <form name="form1">
  11.     <H3 align="center"><B>Formular</B></H3>
  12.     <P>Nume&nbsp;<INPUT type="text" name="nume"/></P>
  13.     <P>Prenume&nbsp;<INPUT type="text" name="prenume"/></P>
  14.     <P>Gender&nbsp<INPUT type="radio" name="gender">Male</INPUT>
  15.     <INPUT type="radio" name="gender">Female</INPUT></P>
  16.     <P><INPUT type="text" name="first">Number1</INPUT></P>
  17.     <P><INPUT type="text" name="second">Number2</INPUT></P>
  18.     <P><INPUT type="button" value="+" name="addButton" onClick="adunare()"/>
  19.     <INPUT type="button" value="-" name="subButton"/></P>
  20.     <P><TEXTAREA name="txtarea" rows="20"></TEXTAREA></P>
  21.     <P><INPUT type=submit name=submit value="Submit"/></P>
  22. </form>
  23. </body>
  24. </html>
  25.  
I get the error on the 18th line (after i click the "addButton"). At this point, it should only display a message (in the future, it will do something else). Please, tell me if you know why i get the error.
Thank you.
May 7 '11 #1

✓ answered by johny10151981

Check carefully
Expand|Select|Wrap|Line Numbers
  1. <SCRIPT language="Javascript" type=”text/javascript”>
  2. function adunare(){
  3. alert('please work');
  4. }
  5. </SCRIPT>
your type attribute it was suppose to be contain either single quote or double quote. nothing else. I guess you are using multi-byte text. when you typed you probably typed keeping other language on. as a result your double quote is not double quote something else. Fix it. All will be fixed

2 1367
johny10151981
1,059 1GB
Check carefully
Expand|Select|Wrap|Line Numbers
  1. <SCRIPT language="Javascript" type=”text/javascript”>
  2. function adunare(){
  3. alert('please work');
  4. }
  5. </SCRIPT>
your type attribute it was suppose to be contain either single quote or double quote. nothing else. I guess you are using multi-byte text. when you typed you probably typed keeping other language on. as a result your double quote is not double quote something else. Fix it. All will be fixed
May 9 '11 #2
Thank you, i just copied the type attribute from a book and i didn't notice it doesn't use double quotes. Now it works.
May 9 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Bill | last post by:
I call a function in my .js file like this: onClick="location.href='blank.html' + generateSearchStringFromForm('section')" where section is the name of my form. The function is defined as...
5
by: Rick | last post by:
I wrote the following code as part of a page where users can reorder a list of items by highlighting an item in a list box and clicking an "up" or "down" button to move the items around. The code...
9
by: matt | last post by:
I had this web site working without problems a day ago. I went to add some images on one of the pages in my site and now the index.html page is popping up error messages when ever the page loads...
3
by: undercups | last post by:
When I run page I immediatley get "Object expected" message and the tag <body onload="setfocus()" is highlighted. The error occurs in this snippet from within the script file function...
4
by: Daniel | last post by:
Hi, I have problem to get the control id and set its visible to true/false(mean show/hide). here is my code: <%@ Control Language="vb" AutoEventWireup="false" Codebehind="ucNavbar.ascx.vb"...
11
by: westplastic | last post by:
This one is driving me insane. The script works perfect on Firefox, but Internet Explorer keeps complaining about "Error Object Expected" and stuff like that. I've run it through Firefox's Java...
11
by: Dagwood Bumstead | last post by:
I play around with js a little... I just don't get this. The file below is just trying out some things... it does exactly what I want (hides/displays some things, no big deal) The problem is...
5
by: JLuv | last post by:
I have a javascript function defined in my <headtag on my ASP.NET page. In the code-behind i have the lines... void pGrid_DeleteCommand(object source, DataGridCommandEventArgs e) { string...
1
by: JOJO123 | last post by:
I got here in search of an answer to this Javascrpt question. I upgraded jave on XP Ie 7, acrobat 5.1 and suddenly can't open any pdf files on web sites using IE. I see u guys all say, this is a...
2
by: thj | last post by:
Hi. I've got this form that I'm trying to validate: <form id="periodForm" action="" method="post"> <p> Periode: <input id="startDate" name="startDate" type="text" size="7" value="<%=...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.