Guest User

Untitled

a guest
Jan 20th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. var customerTypeFields = [];
  2. customerTypeFields['Individual'] = ['First Name(s)', 'Last Name', 'Date of Birth'];
  3. customerTypeFields['Limited Company'] = ['Name', 'Company Number'];
  4. customerTypeFields['Partnership'] = ['Name', 'Company Number'];
  5.  
  6. $('#customer-type-selector').chosen().change( function() {
  7. var visibleFields = customerTypeFields[$(this).children("option[value='" + $(this).attr('value') + "']").text()];
  8. console.log(visibleFields);
  9. $.each(visibleFields, function(i, field) {
  10. $('#customer-features').find('input[data-feature-type=' + field + ']').parent().parent().show();
  11. });
  12. });
  13.  
  14. Uncaught Error: Syntax error, unrecognized expression: input[data-feature-type=First (s)]
  15.  
  16. (...) .find('input[data-feature-type="' + field + '"]') (...)
Add Comment
Please, Sign In to add comment