From 1d3d51e09831bb01b6655919efa4b0fd4eb6f596 Mon Sep 17 00:00:00 2001 From: Andrew Maier Date: Tue, 3 Jan 2017 15:13:46 -0500 Subject: [PATCH] Wire up functionality on form --- _pages/claims/new.html | 8 ++++++-- javascripts/form.json | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/_pages/claims/new.html b/_pages/claims/new.html index 9048a48..0cd7ea3 100644 --- a/_pages/claims/new.html +++ b/_pages/claims/new.html @@ -40,10 +40,10 @@

How it works

// When the schema and form are available, render the form $.when(json_schema, json_form).done(function() { JSONForm.fieldTypes['title'] = { - template: '

<%=node.value%>

' + template: '

<%=node.value %>

' }; JSONForm.fieldTypes['section-title'] = { - template: '

<%=node.value%>

' + template: '

<%=node.value %>

' }; JSONForm.fieldTypes['instructions'] = { template: '

<%=node.value%>

' @@ -66,8 +66,12 @@

How it works

.on("change", 'select[name="information.reason"]', function(){ if ($(this).val() == "Manage a recently diagnosed medical condition.") { $('.dependent').hide(); + $($('h2')[3]).hide(); + $($('h3')[3]).hide(); } else { $('.dependent').show(); + $($('h2')[3]).show(); + $($('h3')[3]).show(); } }) .on("change", 'input[name="payment.method"]', function(){ diff --git a/javascripts/form.json b/javascripts/form.json index 788daec..3071713 100644 --- a/javascripts/form.json +++ b/javascripts/form.json @@ -159,6 +159,7 @@ }, { "type": "section-title", + "htmlClass": "dependent", "value": "Residence" }, {