Skip Menu |

This queue is for tickets about the CGI-Ajax CPAN distribution.

Report information
The Basics
Id: 19213
Status: new
Priority: 0/
Queue: CGI-Ajax

People
Owner: Nobody in particular
Requestors: STEFFENW [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.694
Fixed in: (no value)



Subject: return to select list to change options doesn't work
There is a select list and some options: <select id="myselect" ...> </select> I want to set/unset the: <option ... /> ... <option ... /> So I give this "option" string back to CGI::Ajax. Firefox changed the innerHTML of "myselsct" and it works. But the InternetExplorer doesn't do this. I can't see the options then. *** This is the way for InternetExplorer AND!!! Firefox: delete old options: document.getElementById('myselect').removeChild (document.getElementsByTagName('myselect')[index]); add a new options: var index = null; if (document.all) index = document.getElementById('myselect').length; var newEntry = document.createElement('option'); document.getElementById('myselect').add(newEntry, index);
// I have finished the workaround. function select_list_new_options(id, html_options) { var select_list = document.getElementById(id); while (select_list.options.length > 0) { select_list.remove(0); } var split_regex = /<option\b[^<]*<\/option>/ig; var html_option; while (html_option = split_regex.exec(html_options)) { var new_option = document.createElement('option'); regex = /\blabel\s*=\s*"([^"]*)"/i; regex.exec(html_option); new_option.label = RegExp.$1; regex = /\bvalue\s*=\s*"([^"]*)"/i; regex.exec(html_option); new_option.value = RegExp.$1; regex = />\s*(.*?)\s*</; regex.exec(html_option); new_option.text = RegExp.$1; var option_index = null; if (document.all) option_index = select_list.length; select_list.add(new_option, option_index); } } function ..._proc() { var input1 = arguments[0]; // <option ... </option> and so on var input2 = arguments[1]; // more other elements select_list_new_options('id_of_this_selection_list', input1); document.getElementById('id_of_other_element').innerHTML = input2; }