Solved

select option not showing

Posted on 2011-02-11
11
310 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 54

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 54

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 54

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
More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

 
LVL 54

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

729 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