Hello, good day. I am a newbie in AJAX. I am still starting at this programming language. I just want to ask for help. I have a field "From" and "To". If you select "1969" in "From" field, then in "To" field, the user will automatically select YEAR that is greater than "1969. I still have no idea on how to do it. Thank you again in advance. More power!

The most common mistake ever made in this forum: AJAX is not a programming language, it is a set of javascript functions that allow you to send/retrieve data to pages when the page is already loaded. And, for the thing you want, no AJAX is needed: just regular javascript will do the trick.

The code:

<script type="text/javascript">
function calc_to(from_year) {
// Start year:
var start = parseInt(document.getElementById("min_year").value);
// End year:
var end = parseInt(document.getElementById("max_year").value);
// Total amount of years:
var year_amount = parseInt(end) - parseInt(start);
// Amount of years selected:
var auto_added = from_year - start;
var innerHTMLto_year = "";
innerHTMLto_year += '<option value="">Select a year</option>';
var maximum_future_years = 20;
for (i = 0; i < maximum_future_years; i++) {
var year = auto_added + i + 1 + start;
innerHTMLto_year += "<option value='" + year + "'>" + year + "</option>";
document.getElementById("to_year").innerHTML = innerHTMLto_year;
From <select name="from_year" id="from_year" onchange="calc_to(this.value)">
<option value="" selected="selected">Select a year</option>
<option value="2000" id="min_year">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
<option value="2005" id="max_year">2005</option>
</select> to 
<select name="to_year" id="to_year">
<option value="" selected="selected">Select a year</option>


Thank you very much for your reply. It worked. Thank you. Thank you. ^_^ ..Daniweb is the best site ever!.