JavaScript Tutorial - Dynamic Select Year List Script HTML Form Elements

preview_player
Показать описание
Learn to program dynamic year select lists in HTML forms to avoid the need to write up to 100 lines in your HTML. The JavaScript loop will write the options for you in a for loop. We can do this easily because years are numeric and incremental.
Рекомендации по теме
Комментарии
Автор

Adam, fabulous! It's because of you I am now at university studying Digital Media, Web Software & Software/Gaming Design! It was by watching your videos and following the first web intersect series I learned PHP, you honestly are amazing; you've literally made my ambition of career possible. Thanks!

tasticross
Автор

I will make another PHP version now. Good point. But not many people would disable JavaScript cuz they would disable almost everything cool/interactive on the web today.

AdamKhoury
Автор

He already mentioned it in the video. You can do it this way: var date = new Date(); var year = date.getFullYear(); and then in FOR loop go for(var i=1900;i <= year; i++). Hope I helped.

StefanMalic
Автор

Learnt something new once again :D thanks Adam!

charliechasesmountains
Автор

One thing, how do you order that? To show the latest year, meaning start from 2013 and not 1900.

PauloFerreira-edyo
Автор

If i have a button/radio button and after click on button the dynamic year list going to execute .so, how to do that ?? please help me ..

vedvratdeshpande
Автор

Would there be any advantage to using JavaScript over PHP. If a user has JavaScript disabled this would not work, however it would with PHP.

RyanJ_
Автор

Hello Adam sorry for insisting can you please provide to us a tutorial about a modal window without using any plugin?

FouchimiLeBoss
Автор

What if you have Lets say a Music List an Artist list and a Song List. How do you link them together to choose the music the artist and the song? Would Love to have an answer please. Thank you.

andrekotze
Автор

So wait, you still have to update it each year?

dragonboy
Автор

Nice example but for this scenario I would just use php instead of javascript. The syntax would be very similar.

CoryWCordell
Автор

As a programmer you can die? Pretty sure I'm already dead. On the inside. =)

ALulzyApprentice
welcome to shbcf.ru