User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 391,789 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,521 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

Pull down menue using getElemntById --Help Please

Join Date: Apr 2008
Posts: 17
Reputation: vanessia_1999 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
vanessia_1999 vanessia_1999 is offline Offline
Newbie Poster

Pull down menue using getElemntById --Help Please

  #1  
May 16th, 2008
Hi everyone, I am so new to javascript and it is really giving me a micrain. It looks easy but tend to be hard. Atleast for me since I am a beginner.

I need help please. I need to make work with the element getElementById
I have tried numerous way for days and nothing is working. All I am trying to do is when onchange the user go on the option credit card, the credit card information box shows. This is what I have in the script tag. Can some please tell me what am I doing wrong and what should I have done?

  1. function CheckForCreditCard()
  2. if document.getElementById("divCreditCardInfo").options3].selected == true)
  3. {
  4. CreditCardInfo.style.visibility = "visible";
  5. }

below is in the body

  1. <select name="selPayment" onchange="CheckForCreditCard();">
  2. <option value="Cash">Cash</option>
  3. <option value="Check">Check</option>
  4. <option value="Credit Card" selected="selected">Credit Card</option>
  5. </select>
  6.  
  7.  
  8. <div id="CreditCardInfo"> <br />
  9. Card Number:
  10. <input name="selCreditCardInfo" size="20" type="text" />
  11. &nbsp;&nbsp; Month:
  12. <input type="text" name="txtMonth" size="4" />
  13. &nbsp;&nbsp;Year:
  14. <input name="txtYear" size="4" type="text" />
  15. </div>
Last edited by peter_budo : May 16th, 2008 at 6:50 am. Reason: The code tags encapsulate your code, not to be replace by your code ;)
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 5:11 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC