473,657 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Object required problem cant figure out

4 New Member
hey there this script works fine in firefox.

but in ie the this call
Expand|Select|Wrap|Line Numbers
  1. document.getElementById(form).style.display='block';
gives me object required, well i don't know much about java and can't figure out how to make it work

EDIT: one thing to note is if i pass the value manually with " ' " it works fine im guessing its because form is passing like a string but wouldn't that be ok?!
some help please.

Thanks

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function display_form(form){
  3.     var pre = new Array(3);
  4.     pre[0] = 'ins_';
  5.     pre[1] = 'del_';
  6.     pre[2] = 'mod_';
  7.     var suf = new Array(3);
  8.     suf[0] = 'cli';
  9.     suf[1] = 'est';
  10.     suf[2] = 'enc';
  11.     var div_name = new Array(3);
  12.     for (var i=0;i<3;i++){
  13.         div_name[i] = new Array(3);
  14.     }    
  15.     for (var i=0;i<3;i++){
  16.         for(var j=0;j<3;j++){
  17.             div_name[i,j] = pre[j] + suf[i];
  18.             document.getElementById(div_name[i,j]).style.display='none';
  19.         }
  20.     }
  21.     document.getElementById(form).style.display='block';
  22. }
  23. </script>
  24.  
  25.  
  26. //AND this is the call
  27.  
  28.         <select onchange="javascript: display_form(document.getElementById('accao').value);" name="accao" id="accao">
  29.  
Oct 19 '07 #1
7 2306
gits
5,390 Recognized Expert Moderator Expert
hi ...

welcome to TSDN ...

try to rename the parameter of your function. may be IE handles that as a keyword ...

kind regards
Oct 19 '07 #2
griffinheart
4 New Member
hi ...

welcome to TSDN ...

try to rename the parameter of your function. may be IE handles that as a keyword ...

kind regards
na it still gives me object required =|
Oct 19 '07 #3
gits
5,390 Recognized Expert Moderator Expert
[HTML]<select onchange="javas cript: display_form(do cument.getEleme ntById('accao') .value);" name="accao" id="accao">[/HTML]

is equivalent to:

Expand|Select|Wrap|Line Numbers
  1. <select onchange="display_form(this.value);" name="accao" id="accao">
could you trace what the value is and whether the element with that id exists?

kind regards
Oct 19 '07 #4
griffinheart
4 New Member
[HTML]<select onchange="javas cript: display_form(do cument.getEleme ntById('accao') .value);" name="accao" id="accao">[/HTML]

is equivalent to:

Expand|Select|Wrap|Line Numbers
  1. <select onchange="display_form(this.value);" name="accao" id="accao">
could you trace what the value is and whether the element with that id exists?

kind regards
Im sorry it works now =O would u happen to know why? whats the difference?
Oct 19 '07 #5
gits
5,390 Recognized Expert Moderator Expert
what code do you use now? because i think there is no difference ... except IE may have problems when setting name and the id to equal values?
Oct 19 '07 #6
griffinheart
4 New Member
what code do you use now? because i think there is no difference ... except IE may have problems when setting name and the id to equal values?

only changed this.value like u recommended
Oct 19 '07 #7
gits
5,390 Recognized Expert Moderator Expert
could you try to use your old code and alert the param form as it is passed to the function? i assume it is undefined? ...
Oct 19 '07 #8

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

Similar topics

6
9343
by: Steve Richter | last post by:
I am getting error in a vbscript: ActiveX component cant create object: Excel.Application. The vbscript code is: Dim objExcel Set objExcel = CreateObject("Excel.Application") I am pretty sure it is a permission issue because the script works when I point the browser directly at the .htm file on the c: drive: c:\inetpub\wwwroot\DemoSite\VbScriptTest.htm
5
2534
by: Graham | last post by:
I have created a custom MembershipProvider called "LassieMembershipProvider" that derives from "MembershipProvider". This providor is located in a Businesslogic layer dll called "Enlighten.LinkMad.Businesslogic". In one of my frontend websites I use this type to authenticate a user who is trying to login. The following excerpt is from the web.config of the particular site showing the reference to the custom provider, allowing .Net to do...
1
2304
by: Angus Lepper | last post by:
I'm writing a stock ticker for a stock market simulation, and can load the data into the xmlreader in the first place, but can't figure out how to refresh/update the data in it. Any ideas? Code: Public Class Form1 Inherits System.Windows.Forms.Form
8
2465
by: ST | last post by:
Hello everyone, Can anyone help me with this error above when I debug my web app project in vstudio.net?? I can't figure it out! It was working fine for months, and now all of a sudden it's not!! This is the error: biopsy.searchsubject.btnSubject_Click(Object Sender, EventArgs e) in C:\INetPub\WWWRoot\biopsy\searchsubject.aspx.vb:198 System.Web.UI.WebControls.Button.OnClick(EventArgs e)
1
24616
by: Mike Clark | last post by:
I have a webservice that works great on localhost, but as soon as I promote to a network server I get an exception that doesn't tell me much. There's some implementation details in this exception chain, but here's what it looks like: <pre>System.Web.Services.Protocols.SoapException: Server was unable to process request. --> Object reference not set to an instance of an object. at...
2
7374
by: g35rider | last post by:
Hi, I have the following code that is giving this error, I cant simplify the code, I was just testing some theory for something we are doing and was getting an issue here. Please someone point out whats wrong with my code. class MsgData { char* data;
6
1811
by: Murray Hopkins | last post by:
Hi. THE QUESTION: How do I get a reference to my Object when processing an event handler bound to an html element ? CONTEXT: Sorry if it is a bit long. I am developing a JS calendar tool. One of the requirements is that the calendar will need to display a varying number of months (1..3)
1
1725
by: grbgooglefan | last post by:
I am in a perculiar situation. I want to use PyRun_SimpleString for creating Python functions in embedded Python in C++. But there could be cases when Python function code compilation could fail & PyRun_SimpleString will return -1 as return status. At this time, it prints the error message to sys.stderr. So, we do not have any control or cannot use that message to show to user to correct the errors in the function code. I could assign an...
7
2936
by: Ibys | last post by:
hi, hoping i have posted this in the right section this time :) i am doing my javascript still, and cant figure out why i keep getting an error: object expected message for validateform() im just not sure what i have done wrong with it, i have tried to give it a function, just cant find where my mistake is. any help would be greatly appreciated, thanks :) <html> <head> <title>activity 2.22</title> </head> <script type="text/javascript">
0
8403
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8509
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7345
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6174
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2735
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.