What's the problem -- Year dropdown isn't displayed !!

Hye guys,
I have two JSPs which access a MySQL database.
In the first JSP, I read email id's from the database.
Here's the code for it :
JSP1 :
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> comboscriptsdb1.jsp </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language="javascript">
function doSubmit()
     var str = document.f1.emails.options[document.f1.emails.selectedIndex].value;
     if (str == 0)
          alert("No Email address selected !!");
          return false;
     else
          document.f1.action="http://localhost:8080/examples/comboscriptsdb2.jsp?email=" + str;
          document.f1.submit;
</script>
</HEAD>
<BODY>
<form name="f1" method="post">
<select name="emails">
<option value="0" selected>Select E-mail Address</option>
<%
Connection con;
Statement stmt;
ResultSet rs;
String SQL;
String mailid="";
try
     Class.forName("org.gjt.mm.mysql.Driver");
     con = DriverManager.getConnection("jdbc:mysql://localhost/testdb?autoreconnect=true","","");
     stmt=con.createStatement();
     SQL = "SELECT email FROM mytable";
     rs = stmt.executeQuery(SQL);
     while(rs.next())
          mailid = rs.getString(1);
          %>
          <option value=<%=mailid%>><%=mailid%></option>
          <%
          con.close();
catch (Exception e) {}
%>
</select>
<input type="submit" value="Submit" onClick="javascript:doSubmit()">
</form>
</BODY>
</HTML>This works fine and shows the email ids in the dropdown. However, the second JSP is giving problems and I don't know why it's not displaying the Year dropdown list. Here's the code for it :
JSP2 :
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> comboscriptsdb2.jsp </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language="javascript">
</script>
</HEAD>
<BODY>
<%
Connection con;
Statement stmt;
ResultSet rs;
int dob,mob,yob;
String SQL="";
String email = request.getParameter("email");
try
     Class.forName("org.gjt.mm.mysql.Driver");
     con = DriverManager.getConnection("jdbc:mysql://localhost/testdb?autoreconnect=true","","");
     stmt = con.createStatement();
     SQL = "SELECT * FROM mytable where email like'" + email + "'";
     rs = stmt.executeQuery(SQL);
     if (rs.next())
          out.println(rs.getString(1));
          dob = rs.getInt(2);
          mob = rs.getInt(3);
          yob = rs.getInt(4);
     %>
          <br><br>
          <select name="dob">
          <%
               for (int i=1;i<=31;i++)
                    if (dob == i)
                         %>
                    <option value=<%=dob%> selected><%=dob%></option>
                    <%
                    else
                    {%>
                         <option value=<%=i%>><%=i%></option>
                    <%}
          %>
          </select>
          <select name="mob">
          <%
               String months[] = {"January","February","March","April","May","June","July","August","September","October","November","December"};
               for(int i=0;i<=12;i++)
                    if (mob == i)
                         %>
                         <option value=<%=mob%> selected><%=months[i-1]%></option>
                         <%
                    else
                         %>
                         <option value=<%=i%>><%=months%></option>
                         <%
          %>
          </select>
          <select name="yob">
          <%
               for(int j=1940;j<=2005;j++)
                    %>
                    <option value="<%=j%>"><%=j%></option>
                    <%
          %>
          </select>
          <br>
          <hr>
          <br>
          Home
     <%}
     else
          out.println("<font color=red><b>SORRY !!</b> No Record Found...</font>.");
          out.println("<br><hr><br>");
          out.println("<a href=http://localhost:8080/examples/comboscriptsdb1.jsp>Retry</a>");
     rs.close();
     con.close();
catch (Exception e) {out.println(e.getMessage());}
%>
</BODY>
</HTML>
Here, I am simply displaying the Date, Month and Year of the email id that I selected in the JSP1.
The problem is that the Year dropdown list does not appear. The date and month ones are OK.
Can any1 help me ?

Hi,
Sorry for my previous posting. You pelase check str value by printing it. You can modify your code
<script language="javascript">
function doSubmit()
     var str = document.f1.emails.value;
     if (str == "0")
          alert("No Email address selected !!");
          return false;
     else
          document.f1.action="http://localhost:8080/examples/comboscriptsdb2.jsp?email=" + str;
          document.f1.submit;
</script>
I t works. ALl the best.
Regards,
Sudheer Varma Dandu

Similar Messages

  • I have a mid 2011 macbook air and a new Apple TV but I can't mirror. What's the problem? I have checked display settings and I don't have the "allow mirroring" option there.

    What is the problem?

    About AirPlay and Airplay Mirroring
    AirPlay Mirroring requires a second-generation Apple TV or later, and is supported on the following Mac models: iMac (Mid 2011 or newer), Mac mini (Mid 2011 or newer), MacBook Air (Mid 2011 or newer), and MacBook Pro (Early 2011 or newer). For non-qualifying Macs you can try using Air Parrot.
    Several Apple Articles Regarding AirPlay
    Apple TV (2nd and 3rd gen)- How to use AirPlay Mirroring
    How to set up and configure AirPort Express for AirPlay and iTunes
    iTunes- Troubleshooting AirPlay and AirPlay Mirroring
    iTunes- Using AirPlay
    Apple TV (2nd and 3rd gen)- Understanding AirPlay settings
    About AirPlay Mirroring in OS X Mountain Lion
    iTunes 10- About playing music with AirPlay
    Troubleshooting AirPlay and AirPlay Mirroring
    Using AirPlay
    Thanks to the $15 Beamer, AirPlay streaming is still possible on Macs  that do not support Airplay and mirroring.
    Other solutions are the Air Parrot, StreamToMe, and AirServer.

  • Firefox will not access the internet. I have used Firefox for years and the past week I have not been able to get on the internet??? What is the problem. My interent works as I get email and can iuse Internet Explorer to access.

    Firefox will not access the internet. I have used Firefox for years and the past week I have not been able to get on the internet??? What is the problem. My interent works as I get email and can iuse Internet Explorer to access

    Which version of Firefox are you using?
    See
    * https://support.mozilla.com/en-US/kb/Firefox%20cannot%20load%20websites%20but%20other%20programs%20can

  • HT4623 i have i-phone 3gs purchased unlocked from usa 2 years back version 4.1 recently when i upgrade my version using i-tunes to 6.o I can not activate my i-phone , the msg server busy since last week I not understand what is the problem ?

    have i-phone 3gs purchased unlocked from usa 2 years back version 4.1 recently when i upgrade my version using i-tunes to 6.o I can not activate my i-phone , the msg server busy since last week I not understand what is the problem ?

    The 3GS was not sold as an unlocked phone in the US 2 years ago and AT&T did not offer unlocking then.
    You bought a hacked phone. The Apple servers can detect the hack and have now disabled activation. Contact AT&T and find out if you qualify to have it unlocked or buy a new legitimately unlocked phone.

  • I have had Itunes installed on my laptop for many years. I t started malfunctioning so I uninstalled it. I tried to reinstall and there is persistent error in installing . What is the problem ? How can I solve this?

     

    "It started malfunctioning so I uninstalled it".
    That may have been necessary, may not have.
    "I tried to reinstall and there is persistent error in installing.  What is the problem?"
    No clue.. you've not provided us any details. 
    "How can I solve this?"
    Search these forums or google for the error occurring or post the error so that others can help you.

  • My MacBook Pro turns on but not all the way, it gives me an icon of a grey folder with a question mark in the middle, and won't go further that that. Anyone knows why, or what's the problem?

    My MacBook Pro turns on but not all the way, it gives me an icon of a grey folder with a question mark in the middle, and won't go further that that. Anyone knows why, or what's the problem?

    If these do not resolve the issue or if you are not comfortable with proceeding through these steps then take your Mac to an Apple store or an Apple Authorized Service Provider.  An Apple store will perform these initial steps, diagnose the problem, and give an estimate for repairs (if needed).  If the Mac is less than one year old or is covered by AppleCare any repairs would be free.
              Genius reservation http://www.apple.com/retail/geniusbar/ .
              or find an Apple Authorized Service Provider https://locate.apple.com/country

  • Screen goes black.....I've tried everything!!!  what's the problem???

    went to verizon store (which turned out to be a "reseller store"...more on that later) for my "new every two" upgrade.....guy told me about the new samsung fascinate....he even told me i would actually be the first person to buy one from him.......probably after a week after purchasing the phone, i noticed that my screen would on occasion go black, and i could not get it to "wake up".  the phone is still on.....when i touch the bottom icons, they light up white.....phone definitely still on.....phone can ring, and i can even answer it by sliding the puzzle piece in place (screen stays black, i just know where the piece is). 
    i took it to the store where i purchased it....same guy who sold me the phone says it is almost definitely from some sort of app and i should try deleting all my apps.....i told him i had searched the internet looking for some answers, and there were a few known issues with samsung fascinate blank screens......he said to delete the apps and see what happens.  so like an idiot, i left hoping he would be correct.  well i deleted all my apps when i got home.....didn't make a difference....still had the same problem.
    a day or two later, i was near a regular verizon retailer.....went to tech specialist.....as i was with him, the phone had the "black screen of death".....he was puzzled by it.....he looked it up on the computer and he told me that it was a "known issue" that verizon was aware of.  i then asked him if i could swap the phone for another phone as it was still within 30 days of my purchase.....he said he could not do that since i bought from a "reseller".....the official verizon stores would not honor the return of phones purchased from resellers and that i would have to go back through the reseller (this was frustrating news)  he told me all about official verizon stores vs. the reseller stores.....he told me that the official verizon stores always have service technicians.  i had assumed that since the store where i purchased the phone said verizon all over the front and even had verizon flags flying out front that it was a verizon store.....turns out it wasn't quite the same.  the verizon tech also said that even if i had purchased the phone from the official retailer, they would NOT swap it with a new fascinate since it was a known issue.  i would have to get something else.
    after leaving the official verizon store, i went straight to the other store......told the salesman the whole story......he reset the phone for me.  as i'm on the way home after the fresh reset....guess what.....same problem.....black screen of death.
    so here i am again......{word filter avoidance}
    is wrong with my phone?  aside from the black screen, i really do like the phone, but at this point, i don't know what the problem is and my new phone is worthless.  i'm heading back to the reseller again (for the third time now) and i guess i'll try to get another phone......i really like the fantasy, but i have no faith in it. 
    i have reset the phone 3 times now myself, i actually just did it the third time just before this post.  i reset the phone, and screen went black within just a few minutes....can't get it back.  phone is on.....i can hear a call and texts......what could the problem be?????  i've tried everything noah suggested.....charger in and out....remove battery.....i've done all that....1,000 times.  when the phone does actually wake up, it seems to be completely random as to when it happens.....there's NOTHING i can do to wake it up, and there's NOTHING i can do to stop it from crashing out.
    PLEASE HELP!!!!  i've removed battery.....reset.....removed all apps.....put on and off of charger.....my next move is to smash this {word filter avoidance}
    into about 5,000 pieces.
    ps - i've had a verizon cell phone for 16 years....i've never had a problem like this with a brand new phone.  i hate to say it, but fascinate owners BEWARE.  i can say with 100% certainty that i did not damage this phone.....and i did download some apps, but not that many, and they were all very highly rated and recommended....this should not have happened.
    and also, i'm sure there are some great resellers out there, but from what the official verizon guy told me, you are definitely better off buying directly from verizon. 

    If you have not done a factory reset on the device, I recommend doing a complete  factory reset.  
    Factory Reset  - Warning this will reset device back to original factory settings.
    This method will not erase any MDN/MIN information
    Turn off the phone 
    Press Power + Volume Up/Down at the same time and hold until display will show a triage android screen 
    Display will show: 
    Reboot system Now 
    Apply sdcard:update.zip 
    Wipe Data/Factory Reset 
    Wipe Cache Partition
    Use VOL Down key to scroll down to "Wipe Data/Factory Reset", press home icon to select option and wipe device. 
    Display shows "All user data will be wiped out", press VOLUME Up to continue or VOLUME Down to exit. 
    Press Volume Up 
    Press Home to select "Reset System Now" - device will reboot
    If the problem persist I recommend having a store technician take a look at the device.
    Copy and paste the link below into your browser's address bar for the store locator.  
    http://www.verizonwireless.com/b2c/storelocator/index.jsp

  • Help : After upgrade to IOS5, I only can use my iphone 3gs in Spore instead of Msia. Any1 know what is the problem & how to solve it?!

    I bought iphone 3gs in singapore last year,I had no problem to use it in Singapore & Malaysia but after i upgrade to ios5,i can't use it in malaysia.It will automatic restart my phone itself. Is it because of IOS5 problem?!Because when I register my itune a/c, I selected the country is Singapore. Anyone know what is the problem & how can I solve it?!

    If it automatically restarts the phone firmware is corrupt. Restore the phone with iTunes and set up as a new phone, do not restore your backup, which is likely where the corruption is. If it then works you can try restoring just the backup. If that breaks it again you know where the problem is; you will have to start over and manually reinstall your content.
    To restore just the backup, right click on the phone's name in iTunes and select "restore from backup"

  • The battery of my iPhone 5 easily discharges even if not in use. This started 11 months after purchase. The unit passed the Apple Battery Health Test Protocol but the performance showed otherwise. What is the problem and how do I solve it?

    The battery of my iPhone 5 easily discharges even when not in use. The unit was tested by Apple and passed the Battery Health Test although the performance showed otherwise. The battery deterioration started 11 months after purchase and is not covered by Apple warranty. What is the problem of the iPhone5 and would appreciate suggestions on how to address this problem. By the way, I have a 2 year old iphone 4S with a battery performance as good as when it was bought two years ago.

    Hi there Dan Laven,
    You may find the information in the article below helpful.
    iPhone and iPod touch: Charging the battery
    http://support.apple.com/kb/ht1476
    About battery life and the battery
    Battery life and number of charge cycles vary by use and settings. Find more information about batteries for iPhone and iPod.
    Find information on how long the battery is expected to last between charges.
    Rechargeable batteries have a limited number of charge cycles and may eventually need to be replaced.
    -Griff W. 

  • What is the problem with Itunes 11.0.1.12 and adding music to the Library?

    What is the problem with Itunes 11.0.1.12 and adding music to the Library?  I had no problems when I updated, just had to get used to the new format and appearance.  Added a few albums here and there, and then today I can't get anything in the Library.  I've always just dragged and dropped my music with no problems.  I've had an Ipod for the last six years and never encountered any big problems with Itunes or my various Ipods.

    Why is this Itunes such a pile of junk?  If I restart my computer I can sometimes find the recently added music in my Itunes Library. 
    It would be nice to know if other people are having the same problems.

  • I installed the InDesign CC Testversion and now i try to open INDD-Files from earlier Version. Always i get the error "This file is made by an earlier Version...." but it´s CC that is the latest Version. What is the problem ? Should i have to convert the

    I installed the InDesign CC Testversion and now i try to open INDD-Files from earlier Version. Always i get the error "This file is made by an earlier Version...." but it´s CC that is the latest Version. What is the problem ? Should i have to convert the files ?

    Adobe has been using confusing version names for at least five years.
    There are now two versions labeled CC, version 9 and version 10 (also known as CC 2014). Version 10 is the latest, and if you attempt to open a version 10 file in Version 9 that is not fully patched you will get an error message telling you that the file cannot be opened. The latest patch for version 9 should use a cloud-based service at Adobe to convert version 10 files to IDML and allow you to open that.
    I suspect you may be using an older operating system. Version 10 requires that your system runs at least OS X 10.7 or Windows 7 SP1 and if you are not it will not even be offered to you.

  • TS1368 what is the problem if the message ,We could not complete your iTunes Store request. The iTunes Store is temporarily unavailable. Please try again later is shown

    what is the problem if the message -We could not complete your iTunes Store request. The iTunes Store is temporarily unavailable. Please try again later is shown

    The store isn't unavailable, I can login via my iPhone and iPad but not via iTunes on my Windows PC. I've had this problem all weekend and still getting it today.  I'm running the latest version of iTunes, I've uninstalled and reinstalled Safari as someone on another site suggested, no difference. I have all the latest Windows updates.
    Lots of people seem to have had this problem in the past but I'm struggling to find a solution which worked for them.
    Anyone have any ideas please?
    Thanks.

  • HT1338 what about the problems with the trojan virus is that a problem for my mac as well?

    What about the problems with the Trojan virus will this be a problem also for me using Mac

    What Trojan?
    If you're referring to the DNS Changer Trojan, it's highly unlikely you're affected. The actual distribution of the trojan was stopped several years ago and the perpertrators jailed.
    The FBI has been maintaining the servers used by the trojan for the last 5 years in order to give affected systems time to be purged. They will finally shut them down on Monday.
    Ensure that your router and the Mac's network settings are set for the DNS addresses of your ISP, or if you're not sure what they should be, change them to Open DNS using the IP addresses;
    208.67.222.222
    208.67.220.220

  • After encoding to apple proress 422 FCPX is working so slow. FCP7 Runs with no issues. What is the problem?

    It took all night to encode my video files into proress 422 using compressor.
    I used compressor because FCPX would not even run or simply crash. Im using an Intel Mac 3.06 GHz Core 2 Duo 4 GB 1067 MHz DDR3 OSX 10.6.8
    After the encode I'm able to work on FCPX but it's running like a snail, the video and audio will not play smooth and the windows or event library will not update after clicking the next folder. And if I use an effect or transition FCPX will crash.
    Now if I use FCP7 everything runs so smooth and it runs light years over FCPX
    WHAT IS THE PROBLEM?   I'm trying my best to like FCPX and really work on this project but I have lost two days of work, just by watching this application run so slow.

    your in the wrong discussion, go here:
    https://discussions.apple.com/community/professional_applications/final_cut_pro_ x?view=discussions

  • My sony rdr-gx257 will only record for 2 minutes,what's the problem?

    my sony rdr-gx257 is only about 4 years old,it will only just recently record for about 2 minutes,and will not erase a rw disc. What is the problem?

    Wait, so I am lucky??!! My old Sony Ericsson 810i, which is about 5 years old last for almost a week at a time..
    But seriously, why doesn't the battery last longer?
    I was a little frustrated when I first saw that the battery would not survive that long.
    I have now also used a site from Apple about how to save some batterypower, I hope that will make it some better thanks for responding
    - Konkelikonk, Norway

Maybe you are looking for

  • Session Time out and iTunes login issues

    I am trying to put a digital copy of an Alvin and the Chipmunks DVD into iTunes for holiday tomorrow for my daughters. The redeem code screen comes up fine in iTunes but then next screen after that always says "Session Timeout" your session has timed

  • Properties box does not appear

    I recently upgraded from 6.1 to 7.1. Everything is working fine with DAQ and Motion Control. Today, I noticed some formatting issues with some controls and indicators. When I right click, the short cut appears but if I click on "Formatting and Precis

  • .EPS images in REPORT

    How can we use ".EPS" format images into reports. We can convert into JPEG and "BMP formats and use, but in this case the image gets blurr when zoomed in. I want ot use ".EPS" format straight away in reports.

  • Trying to archive more often: archive_lag_target vs downsizing redo logs

    Hi, I have a small production 10.2.0.1 database (small: all the files are 17GB total) on Linux which is used in Agile PLM. Ever since we went live, it produces only 2-4 archive logs per day. This was OK when our company was only concerned with being

  • How can I save podcast subscriptions?

    I'm running into a frequent "iTunes Library is Damaged" problem on my Mac so I have to rebuild my iTunes library at least once a month. I know how to restore my files quickly and eaisily but the biggest pain is resubscribing to my podcasts. I like to