Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
"object required" error--Please help
Old 01-16-2008, 02:03 AM "object required" error--Please help
Experienced Talker

Posts: 33
Name: subhash garai
Trades: 0
here is my code snippet which i am using

<script type="text/javascript">

function toggle(targetId,count_pic)
{
var j;
var divid;
for(j=0;j<=count_pic;j++){
divid='image'+j;
document.getElementById(divid).style.display="none ";
}

document.getElementById(targetId).style.display="b lock";
//return false;
}
function toggle_photo(change_pos,count_pic)
{
var j, a, start_no_loop, end_no_loop;
var start_prev = parseInt(document.frmToggle.txtStartPrev.value);
var end_prev = parseInt(document.frmToggle.txtEndPrev.value);
var start_next = parseInt(document.frmToggle.txtStartNext.value);
var end_next = parseInt(document.frmToggle.txtEndNext.value);
var max_pic_no = parseInt(count_pic);
max_pic_no = max_pic_no + 1;

if(change_pos == 'next'){
start_no_loop = start_next;
end_no_loop = end_next;

start_prev = start_prev + 3;
end_prev = end_prev + 3;
start_next = start_next + 3;
end_next = end_next + 3;
document.frmToggle.txtStartPrev.value = start_prev;
document.frmToggle.txtEndPrev.value = end_prev;
document.frmToggle.txtStartNext.value = start_next;
document.frmToggle.txtEndNext.value = end_next;
document.getElementById('show_prev').style.display ="block";
}
if(change_pos == 'prev'){

start_prev = start_prev - 3;
end_prev = end_prev - 3;
start_next = start_next - 3;
end_next = end_next - 3;
document.frmToggle.txtStartPrev.value = start_prev;
document.frmToggle.txtEndPrev.value = end_prev;
document.frmToggle.txtStartNext.value = start_next;
document.frmToggle.txtEndNext.value = end_next;
start_no_loop = start_prev;
end_no_loop = end_prev;
document.getElementById('show_next').style.display ="block";
}

if(start_next >= max_pic_no){
document.getElementById('show_next').style.display ="none";
}
for(j=0;j<=count_pic;j++){
div_id='photo'+j;
document.getElementById(div_id).style.display="non e";
}
for(a=start_no_loop;a<end_no_loop;a++){
divshow_id='photo'+a;
document.getElementById(divshow_id).style.display= "block";
}
if(start_prev == 0){
document.getElementById('show_prev').style.display ="none";
}


}

</script>



error is occuring in IE at the code line no.

Last edited by subhash_garai; 01-16-2008 at 02:09 AM.. Reason: mistake to post code snippet
subhash_garai is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-16-2008, 03:02 AM Re: "object required" error--Please help
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
That line of code itself shouldn't do it. Usually "object required" is caused by the HTML page trying to call a Javascript function that doesn't exist. Often times, the line of code being mentioned isn't the line of Javascript code but the line of HTML code on the same page.

To see what I'm talking about, externalize your Javascript (put it into a .js file) and then see if the error exists in more or less the same spot.

Where's the page itself? Maybe we can figure out more.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to "object required" error--Please help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10256 seconds with 12 queries