Warning: Undefined array key "action" in /home/bakers/html/entryreply.php on line 5

Warning: Undefined variable $output in /home/bakers/html/entryreply.php on line 50

Warning: Undefined array key "EntrySubject" in /home/bakers/html/entryreply.php on line 51

Warning: Undefined variable $logintext in /home/bakers/html/entryreply.php on line 97

Warning: Undefined variable $reply_name in /home/bakers/html/entryreply.php on line 103

Warning: Undefined variable $reply_email in /home/bakers/html/entryreply.php on line 104
Perturb.org - interesting technology related things from around the internet

Javascript to work on select boxes

function add_select_option(select_id,text,value) { var select_eid = document.getElementById(select_id); if (!select_eid || !text || !value) { return false; } var option = document.createElement('option'); option.setAttribute('value',key); var text = document.createTextNode(value); option.appendChild(text); select_eid.appendChild(option); return true; }
function remove_select_option(select_id,index) { var select_eid = document.getElementById(select_id); if (!select_eid || typeof(index) != 'number') { return false; } if (!select_eid.options[index]) { return false; } var remove_eid = select_eid.options[index]; select_eid.removeChild(remove_eid); return true; }
function clear_select_options(select_id) { var select_eid = document.getElementById(select_id); if (!select_eid) { return false; } var kids = select_eid.options.length; for (var i = 0;i <= kids;i++) { // Remove the zeroth element as many times as there are items remove_select_option(select_id,0); } return true; }


Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 3.227.235.216
To prevent spam please submit by clicking the kitten: