473,386 Members | 1,702 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,386 software developers and data experts.

JS function is not working in IE

AMT India
This JS function is not working in IE 6 and 7..

Expand|Select|Wrap|Line Numbers
  1. function ValidateRows( checkbox_id ){    
  2.  
  3.     if( document.pageform.eval(checkbox_id).value){
  4.  
  5.         if ( document.pageform.eval(checkbox_id).checked ){
  6.             return true;
  7.         }
  8.     }
  9.     for ( var i=0; i < document.pageform.eval(checkbox_id).length;i ++ ){
  10.         if ( document.pageform.eval(checkbox_id)[i].checked ){
  11.             return true;
  12.         }
  13.     }
  14.     return false;
  15. }
  16.  
The error is 'Object does not support this property or method'. The error line number is the first line of the function.
Oct 8 '07 #1
4 1509
dmjpro
2,476 2GB
This JS function is not working in IE 6 and 7..

Expand|Select|Wrap|Line Numbers
  1. function ValidateRows( checkbox_id ){    
  2.  
  3.     if( document.pageform.eval(checkbox_id).value){
  4.  
  5.         if ( document.pageform.eval(checkbox_id).checked ){
  6.             return true;
  7.         }
  8.     }
  9.     for ( var i=0; i < document.pageform.eval(checkbox_id).length;i ++ ){
  10.         if ( document.pageform.eval(checkbox_id)[i].checked ){
  11.             return true;
  12.         }
  13.     }
  14.     return false;
  15. }
  16.  
The error is 'Object does not support this property or method'. The error line number is the first line of the function.
"eval" is a member function of "window" object.

You should use like ............
Expand|Select|Wrap|Line Numbers
  1. eval("document.pageform.checkbox_id").value
  2.  
instead of ............... "document.pageform.eval(checkbox_id).value"

Debasis Jana
Oct 8 '07 #2
gits
5,390 Expert Mod 4TB
hi ...

you don't need eval at all here ... simply use the correct reference (array-like in this case):

Expand|Select|Wrap|Line Numbers
  1. document.pageform[checkbox_id].value
kind regards
Oct 8 '07 #3
hi ...

you don't need eval at all here ... simply use the correct reference (array-like in this case):

Expand|Select|Wrap|Line Numbers
  1. document.pageform[checkbox_id].value
kind regards

Thanx for the replies....Both of the above code is working in IE....but not in Firefox....
Oct 8 '07 #4
gits
5,390 Expert Mod 4TB
hi ...

simply use the standards-compliant method to retrieve the nodes:

Expand|Select|Wrap|Line Numbers
  1. var node = document.getElementById('your_id');
  2.  
and for the value you may then use:

Expand|Select|Wrap|Line Numbers
  1. var val = node.value;
kind regards
Oct 8 '07 #5

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

Similar topics

5
by: amit kumar | last post by:
I am calling a function which returns pointer to a map. The declaration of the map is map<int,vectxyz*>. vectxyz is a vector containing pointer to a class xyz. For map<int,vectxyz*>* p1 In the...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
1
by: Julie May | last post by:
I have 90% of my function working and I know to get the next 10% it is justa matter of getting the quotations and the escaping quotations correct. Here is the portion that does work: <working...
0
by: serkan | last post by:
Guys, I am trying to get this password reset functionality wor for me but I am not successful at all. Please somebody help me. I get "Your password could not be reset - please try again later" so I...
1
by: den2005 | last post by:
Hi everybody, I am confused and still looking why this codes is not working. Can anyone notice or know why this code is not working? Thanks in advance. Code working: <form id="form1"...
19
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
3
by: shyamg | last post by:
hi all, This javascript is working IE but not working in FIreFox, validating text fields. var dealerid = new keybEdit('abcdefghijklmnopqurstuvwxyz01234567890 ','Alpha-numeric input only.'); ...
10
by: SQACPP | last post by:
Hi, I try to figure out how to use Callback procedure in a C++ form project The following code *work* perfectly on a console project #include "Windows.h" BOOL CALLBACK...
3
by: BibhuAshish | last post by:
Hello guys i have one function which converts the ip/netmask into networkid/netmask and also it shows the message to user that his ip is changed to network id. but that function is working in...
7
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I am using this code to get groups for a user and getting a error (5) on the GetAuthorizationGroups() function . There are two domains. This function works on the local domain but does not work...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.