Jump to content

dynamic


chriscloyd

Recommended Posts

try this function. add to your select field onchange = "updateDropDown();" and put that select box in its own field or div or something with an unique id.

let me know if it works or not


[code]
function updateDropDown(){
var days = new Object();
days['Jan'] = 30;
days['Feb'] = 28;

var month = document.getElementById('month field').value;
for(keyVar in days){
if(keyVar == month){
dayCount = days[keyVar];
continue;
}
}

list = '<select >';
for(var i = 0; i < dayCount.length; i++){
day = i + 1;
list += '<option value="'+ day +'">'+ day +'</option>';
}
list += '</select>';

document.getElementById('idof field that holds your drop down').innerHTML = list;
}
[/code]
Link to comment
https://forums.phpfreaks.com/topic/32153-dynamic/#findComment-149458
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.