Solved

select option not showing

Posted on 2011-02-11
11
308 Views
Last Modified: 2012-06-27
Hi,

There is a select option within a <td> but it's not showing for some reason. I don't see any errors in my code (my IDE) and when I copy and paste the <select> before the body tag it shows up. What's wrong?

http://tutorialref.com/mhms/btgapp.php

Thanks,
Victor
0
Comment
Question by:Victor Kimura
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
11 Comments
 
LVL 51

Expert Comment

by:Huseyin KAHRAMAN
ID: 34872984
you mean this part? there is nothing wrong here and I can see it..
<table align="center" cellpadding="3" style="width: 97%; border:1px solid red">
<tr>
   <td style="width: 50%; padding-bottom: 3px; height: 23px;">&nbsp;* Which class would you like to attend?</td>
   <td style="width: 50%; padding-bottom: 3px; height: 23px;">
      <select name="Which_Class" style="width:250px; height:20px;">
         <option>-- Select Class Date --</option>
         <option value="January 24, 2011" selected>January 2011 - Classes Start Jan 24
         </option>
      </select></td>
</tr>
...
</table>

Open in new window

0
 
LVL 51

Expert Comment

by:Huseyin KAHRAMAN
ID: 34873022
it is because of this

      <script language="JavaScript" src="http://tutorialref.com/mhms/scripts/init.js"></script>
0
 
LVL 51

Expert Comment

by:Huseyin KAHRAMAN
ID: 34873035
I guess this function is responsible for that
/**
************************************
* For btgapp.php
************************************/
function checkDates(){
   var dateDiff
   var ddDate
   var today = new Date()
   var oneDay=1000*60*60*24
   var dateDD = document.btgapp.Which_Class
   var numOpts = dateDD.options.length
   //Remove dropdown options with dates less than 4 weeks out
   for (var i=numOpts-1;i>=0; i--) {
      ddDate = new Date(dateDD.options[i].value)
      dateDiff = (ddDate.getTime()-today.getTime())/oneDay/7
      //alert("dateDiff is: "+dateDiff)
      if (dateDiff < 4){
         dateDD.remove(i)
      }
   }
}

Open in new window

0
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 
LVL 51

Expert Comment

by:Huseyin KAHRAMAN
ID: 34873037
//Remove dropdown options with dates less than 4 weeks out

:)
0
 
LVL 3

Assisted Solution

by:computino
computino earned 500 total points
ID: 34873055
You miss the second option of your select, right? That may be because of your very old way to format that option, I have no other explanation. Everything looks fine, but the option does not even get parsed by the browsers.

Try this version with two major changes, selected="selected" and I got rid of the giant whitespace before the closing </option>:

<option value="January 24, 2011" selected="selected">January 2011 - Classes Start Jan 24</option>
0
 
LVL 3

Expert Comment

by:computino
ID: 34873179
HainKurt let's my suggestion look dumb - I overlooked the JS file.
0
 

Accepted Solution

by:
Victor Kimura earned 0 total points
ID: 34874011
Thanks, fellows. I think there is a problem with the way javascript parses values with space. I changed the value with no spaces. Will accept dashes and underscores too.
0
 

Author Comment

by:Victor Kimura
ID: 34892162
Hi,

I appreciated HainKurt's responses. His response ( 34873037) was the solution he offered but that wasn't the answer. I know HainKurt's responded to other postings I've posted so I do appreciated his answers. It just wasn't the correct answer. Should I offer points to him for his effort? I can split the points.

computino's response (34873055) was the closest. Though the answer wasn't completely correct. The problem was the white spaces in the value of the option and not the option innerHTML text. That's why awarded him the 500 points.

I'm thinking that JS and/or jQuery values may need to be urlencoded (if there are whitespaces) but I'm not certain.

Split the points for the effort I think. Don't know how to do that on my end though. Thanks fellows. I appreciated your responses. =)
0
 

Author Closing Comment

by:Victor Kimura
ID: 34904835
Thank you.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question