Solved

select option not showing

Posted on 2011-02-11
11
312 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 56

Expert Comment

by:HainKurt
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 56

Expert Comment

by:HainKurt
ID: 34873022
it is because of this

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

Expert Comment

by:HainKurt
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 56

Expert Comment

by:HainKurt
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

636 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