Solved

select option not showing

Posted on 2011-02-11
11
299 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
  • 4
  • 3
  • 2
11 Comments
 
LVL 51

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 51

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 51

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
 
LVL 51

Expert Comment

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

:)
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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 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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now