aboutsummaryrefslogtreecommitdiffstats
path: root/web/js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-08-01 16:53:20 +0100
committerStruan Donald <struan@exo.org.uk>2011-08-01 16:53:20 +0100
commit720fc7ff7f9a375389ae4ba67bb56ce55587363a (patch)
tree0d427dc8b51a52163ec91690a33af930b21484cc /web/js
parent8d841abcf6a6539344094927ffb7b82d38b70473 (diff)
display and save extra info for open311 reports
Diffstat (limited to 'web/js')
-rw-r--r--web/js/fixmystreet.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/web/js/fixmystreet.js b/web/js/fixmystreet.js
index 4b19dc53e..2ebf74751 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].attribute;
+ 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');
+ }
+ }
+ }
+ });
+
});