473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to auto select current month from drop down on page load when ever the user vists the page at any time

I have this drop down and I want to auto select the drop down value to current month as the user gets to this page every time, can anyone help me in this regards I am new to java script please let me know as soon as possible

Expand|Select|Wrap|Line Numbers
  1. <select class="customSelect1 floating" id="month" name="month">
  2.                     <option value="1">Jan</option>
  3.                     <option value="2">Feb</option>
  4.                     <option value="3">Mar</option>
  5.                     <option value="4">Apr</option>
  6.                     <option value="5">May</option>
  7.                     <option value="6">Jun</option>
  8.                     <option value="7">Jul</option>
  9.                     <option value="8">Aug</option>
  10.                     <option value="9">Sep</option>
  11.                     <option value="10">Oct</option>
  12.                     <option value="11">Nov</option>
  13.                     <option value="12">Dec</option>
  14.                 </select>
  15.  
Mar 30 '22 #1
1 6033
Dormilich
8,658 Expert Mod 8TB
Use the JavaScript Date object to get the current month and set the dropdown's value accordingly.
Mar 30 '22 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Matthew Louden | last post by:
if the user select the EmployeeID in drop down list, and then click the submit button, and it will look up database and show the Employee Name in the text box, this is easy. But my case is:...
1
by: Abby Lee | last post by:
My page runs fine...I just get the yeld sign with a "!" in it. Ok, I asked this question in the VBscript group and they tell me it's a JavaScript issue even though I don't get the error until I...
3
by: kirke | last post by:
I have a two text box and one select box. two text box will be filled with date values. (in the form of dd-mm-year) First text box is called "start date" Second is "end date" Thus, I want to...
3
by: quoclinh | last post by:
I have an aspx page with code behind that has the initial page load code happens many times as user perform different action on the page, such as select a drop down list. To be more clear,...
10
by: YvesDM | last post by:
Hi, How can I do this, I've got a little form with a dropdown. <select name="maand"> <option value='1'>januari</option> <option value='2'>februari</option> <option value='3'>maart</option>...
2
by: rpeterson84 | last post by:
Hello: I was hoping to gain some insight, a point in the right direction if you will... We use an .asp web page to select from a couple of dynamic drop down menus then enter a number, and press...
0
by: fatroshi | last post by:
Hi, I´m trying to create a simple application with a drop menu. The drop menu should load a page inside the same page. Same as the php inlude("path") function. I´ve find one way to create...
1
by: Adeel Khan | last post by:
I am creating a Simple JSP page Name Address Telephone Disgination I already have Desgination in my oracle table which i want on this page, so user can select from drop down list.
2
by: redrose43311 | last post by:
I am trying to add a code to my contact page that checks for a cookie named NewCookie, and if this cookie is found it will redirect the user to another page called alreadysubmitted. I have tried...
1
by: Douglas47 | last post by:
I am using a drop-down box that FrontPage builds for you, as a drop down menu. Here is the code FrontPage creates (with values you insert): <form method="POST" action="--WEBBOT-SELF--"> ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.