Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
html for year of birth
Old 07-05-2007, 04:02 PM html for year of birth
Novice Talker

Posts: 13
Trades: 0
Hi..
does someone have code i can paste into my 'year' menu.
Im just trying to cut down some time entering all the years for the dropdown menu. Its for a Year of Birth menu. im a beginner html'er

ryan
rneedham is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-06-2007, 09:41 AM Re: html for year of birth
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Not with HTML

but a bit of javascript will
HTML Code:
<form action="" name="formname" method="get">
<select name="year" onChange="forms['formname'].submit()">
<option value="">-- Select Year --</option>

</select>

</form>

<script type="text/javascript">
var today = new Date()
var endYear = 1946 // change to suit your oldest requirement 
var startYear= today.getFullYear()

for (startYear ;startYear>endYear; startYear--) {
	nextItem = document.forms['formname'].year.options.length;
	document.forms['formname'].year.options[nextItem] = new Option(startYear,startYear)
}
</script>
Remove the onChange event from the select box as this will submit the form
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-07-2007, 03:02 AM Re: html for year of birth
Novice Talker

Posts: 11
Trades: 0
very kool!!!!!
legauxenterpris is offline
Reply With Quote
View Public Profile
 
Old 07-07-2007, 07:54 AM Re: html for year of birth
Ninja's Avatar
Experienced Talker

Posts: 30
Trades: 0
A more accessible option would be with PHP which is another scripting language but since your a beginner just keep in mind that certain people have javascript turned off, maybe as high as 5~10%. Your server has to be set up to allow PHP code in order for you to be able to use it.
Ninja is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to html for year of birth
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13228 seconds with 12 queries