diff options
Diffstat (limited to 'web/js')
-rw-r--r-- | web/js/fixmystreet.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/web/js/fixmystreet.js b/web/js/fixmystreet.js index 4b19dc53e..22cd1c64f 100644 --- a/web/js/fixmystreet.js +++ b/web/js/fixmystreet.js @@ -57,4 +57,21 @@ $(function(){ timer = window.setTimeout(email_alert_close, 2000); }); + $('#form_category').change(function() { + if ( category_extras ) { + $('#category_meta').empty(); + if ( category_extras[this.options[ this.selectedIndex ].text] ) { + extras = category_extras[this.options[ this.selectedIndex ].text]; + for ( i in extras ) { + meta = extras[i]; + field = '<div class="form-field">'; + field += '<label for="form_' + meta.code + '">' + meta.description + '</label>'; + field += '<input type="text" value="" name="' + meta.code + '" id="form_' + meta.code + '">'; + field += '</div>'; + $('<p>' + field + '</p>').appendTo('#category_meta'); + } + } + } + }); + }); |