DeveloperBarn Forums

Go Back   DeveloperBarn Forums > Programming & Scripting > JavaScript Programming

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 « Previous Thread | Next Thread »
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old July 1st, 2008, 11:37 AM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 332
Thanks: 23
Thanked 26 Times in 26 Posts
Blog Entries: 1
Rep Power: 1
richyrich is on a distinguished road

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

There shouldn't be a space between the and _

It should be = the_change
Reply With Quote
Sponsored Links
  #22 (permalink)  
Old July 1st, 2008, 12:07 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 185
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 (permalink)  
Old July 1st, 2008, 12:17 PM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 332
Thanks: 23
Thanked 26 Times in 26 Posts
Blog Entries: 1
Rep Power: 1
richyrich is on a distinguished road

Awards Showcase
Classic ASP JavaScript 
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 (permalink)  
Old July 1st, 2008, 12:23 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 185
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 (permalink)  
Old July 1st, 2008, 12:27 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 185
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 (permalink)  
Old July 1st, 2008, 12:32 PM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 332
Thanks: 23
Thanked 26 Times in 26 Posts
Blog Entries: 1
Rep Power: 1
richyrich is on a distinguished road

Awards Showcase
Classic ASP JavaScript 
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 (permalink)  
Old July 1st, 2008, 12:37 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 185
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 (permalink)  
Old July 1st, 2008, 12:44 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 185
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 (permalink)  
Old July 1st, 2008, 12:46 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 185
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 (permalink)  
Old July 1st, 2008, 01:07 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 185
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


Sponsored Links

ASP.NET Resource Index
a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer.

Free Web Directory
Including Chats and Forums Resources, Offer automatic, instant and free directory submissions.
URLZ Web Directory
URLZ Web Directory

Free Web Directory - Add Your Link
The Little Web Directory
Free Web Directory
Pegasus free web directory is a free directory organised by categories.

Web Directory & SEO Services
dirroot web directory


All times are GMT -4. The time now is 08:56 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 2008 DeveloperBarn.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46