Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Go Back   DeveloperBarn Forums > Programming & Scripting > JavaScript Programming

Sponsored Links

Discuss "drop down problem" in the JavaScript Programming forum.

JavaScript Programming - Javascript is a cross-browser client-side scripting language. Discuss Javascript and AJAX related scripts here.


Reply
 
LinkBack Thread Tools Display Modes
  #21  
Old July 1st, 2008, 11:37 AM
richyrich's Avatar
Super Moderator
 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 417
Thanks: 26
Thanked 34 Times in 34 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
JavaScript Classic ASP 
Total Awards: 2

Default

There shouldn't be a space between the and _

It should be = the_change
Reply With Quote
Sponsored Links
  #22  
Old July 1st, 2008, 12:07 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

i tried it same thing same error

there is no space
Reply With Quote
  #23  
Old July 1st, 2008, 12:17 PM
richyrich's Avatar
Super Moderator
 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 417
Thanks: 26
Thanked 34 Times in 34 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
JavaScript Classic ASP 
Total Awards: 2

Default

Do you have a link to your page so I can see it?

I have copied and pasted the code back from this site, retried it and it still works fine in IE6, 7 and FF for me.
Reply With Quote
  #24  
Old July 1st, 2008, 12:23 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

its on the intranet site

this is the message i get in firefox

Error: document.getElementById(the_div) has no properties
Reply With Quote
  #25  
Old July 1st, 2008, 12:27 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

i did the alert for testing

function changeDivcr(the_div,the_change)
{
alert(the_div);
alert(the_change);
document.getElementById(the_div).style.display=the _change;
}

so the output is div name and then block

so its working

is the syntax right richyrich
Reply With Quote
  #26  
Old July 1st, 2008, 12:32 PM
richyrich's Avatar
Super Moderator
 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 417
Thanks: 26
Thanked 34 Times in 34 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
JavaScript Classic ASP 
Total Awards: 2

Default

The syntax is right. I'm assuming there isn't a space in the_change.

How are you calling this function? It should be called for each div with the_change variable being alternated between block and none depending on whether you want to show or hide the div.
Reply With Quote
  #27  
Old July 1st, 2008, 12:37 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

i copied ur same code richyrich

i just dont get whats wrong

the parameters names are unique
Reply With Quote
  #28  
Old July 1st, 2008, 12:44 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

Ok i found out whats going on

function changeDivcr(the_div,the_change)
{
alert(the_div);
alert(the_change);
document.getElementById(the_div).style.display=the _change;
}

when the alert is fired it always tells me reservecash

when i select credit card i still get the alert reservecash when it should be reservecredit
Reply With Quote
  #29  
Old July 1st, 2008, 12:46 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

dont worry there is no space the_change
Reply With Quote
  #30  
Old July 1st, 2008, 01:07 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

I changed this line

document.getElementById(the_div).style.display=the _change;

to

document.getElementById('the_div').style.display=t he_change;

now there is no error

but it still doesnt show the div
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > JavaScript Programming

Bookmarks

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
display problem with drop downs todd2006 JavaScript Programming 3 May 5th, 2008 05:31 PM
drop down problem todd2006 .Net Development 2 April 23rd, 2008 11:37 AM


All times are GMT -4. The time now is 07:52 PM.



Content Relevant URLs by vBSEO 3.2.0