 | Help you update the livetable URL and refresh the content when the user chooses a different option from a HTML select element |
| Type | Snippet |
| Developed by | Oana Tabaranu |
| License | GNU Lesser General Public License 2.1 |
<select id="document-options">
<option value="selectValue1">select option 1</option>
<option value="selectValue2">select option 2</option>
<option value="selectValue3">select option 3</option>
</select>
document.observe('dom:loaded', function() {
if($('document-options')) {
Event.observe($('document-options'), 'click', function() {
var selectedParameter = $('document-options').value;
// change paramName parameter value in the livetable URL and refresh
var index = ta.getUrl.indexOf('paramName=');
if(index > 0) {
ta.getUrl = ta.getUrl.substr(0, index - 1) + "¶mName=" + selectedParameter;
}
// refresh live table
ta.clearCache();
ta.showRows(1, ta.limit);
});
}
});