|
437 | 437 | <hr>
|
438 | 438 | {{/if}}
|
439 | 439 |
|
440 |
| - {{#if validForm}} |
441 |
| - <form class='card' action='#' method='POST' name='n8n-form' id='n8n-form' novalidate> |
442 |
| - <div class='form-header'> |
443 |
| - <h1>{{formTitle}}</h1> |
444 |
| - <p style="white-space: pre-line">{{{formDescription}}} </p> |
445 |
| - </div> |
446 |
| - |
447 |
| - <div class='inputs-wrapper'> |
448 |
| - {{#each formFields}} |
449 |
| - {{#if isMultiSelect}} |
450 |
| - <div> |
451 |
| - <label class='form-label {{inputRequired}}'>{{label}}</label> |
452 |
| - <div class='multiselect {{inputRequired}}' id='{{id}}'> |
453 |
| - {{#each multiSelectOptions}} |
454 |
| - <div class='multiselect-option'> |
455 |
| - <input type='checkbox' class='multiselect-checkbox' id='{{id}}' /> |
456 |
| - <label for='{{id}}'>{{label}}</label> |
457 |
| - </div> |
458 |
| - {{/each}} |
459 |
| - </div> |
460 |
| - <p class='{{errorId}} error-hidden'> |
461 |
| - This field is required |
462 |
| - </p> |
463 |
| - </div> |
464 |
| - {{/if}} |
465 |
| - |
466 |
| - {{#if isSelect}} |
467 |
| - <div class='form-group'> |
468 |
| - <label class='form-label {{inputRequired}}' for='{{id}}'>{{label}}</label> |
469 |
| - <div class='select-input'> |
470 |
| - <select id='{{id}}' name='{{id}}' class='{{inputRequired}}'> |
471 |
| - <option value='' disabled selected>Select an option ...</option> |
472 |
| - {{#each selectOptions}} |
473 |
| - <option value='{{this}}'>{{this}}</option> |
474 |
| - {{/each}} |
475 |
| - </select> |
476 |
| - </div> |
477 |
| - <p class='{{errorId}} error-hidden'> |
478 |
| - This field is required |
479 |
| - </p> |
480 |
| - </div> |
481 |
| - {{/if}} |
| 440 | + <form class='card' action='#' method='POST' name='n8n-form' id='n8n-form' novalidate> |
| 441 | + <div class='form-header'> |
| 442 | + <h1>{{formTitle}}</h1> |
| 443 | + <p style="white-space: pre-line">{{{formDescription}}} </p> |
| 444 | + </div> |
482 | 445 |
|
483 |
| - {{#if isHtml}} |
484 |
| - <div class="form-group html"> |
485 |
| - {{{html}}} |
486 |
| - <input type="hidden" id="{{id}}" name="{{id}}" value="{{html}}" /> |
487 |
| - </div> |
488 |
| - {{/if}} |
489 |
| - |
490 |
| - {{#if isHidden}} |
491 |
| - <input type="hidden" id="{{id}}" name="{{id}}" value="{{hiddenValue}}" /> |
492 |
| - {{/if}} |
493 |
| - |
494 |
| - {{#if isTextarea}} |
495 |
| - <div class='form-group'> |
496 |
| - <label class='form-label {{inputRequired}}' for='{{id}}'>{{label}}</label> |
497 |
| - <textarea |
498 |
| - class='form-input {{inputRequired}}' |
499 |
| - id='{{id}}' |
500 |
| - name='{{id}}' |
501 |
| - placeholder="{{placeholder}}" |
502 |
| - >{{defaultValue}}</textarea> |
503 |
| - <p class='{{errorId}} error-hidden'> |
504 |
| - This field is required |
505 |
| - </p> |
506 |
| - </div> |
507 |
| - {{/if}} |
508 |
| - |
509 |
| - {{#if isFileInput}} |
510 |
| - <div class='form-group file-input-wrapper'> |
511 |
| - <label class='form-label {{inputRequired}}' for='{{id}}'>{{label}}</label> |
512 |
| - <input |
513 |
| - class='form-input {{inputRequired}}' |
514 |
| - type='file' |
515 |
| - id='{{id}}' |
516 |
| - name='{{id}}' |
517 |
| - accept='{{acceptFileTypes}}' |
518 |
| - {{multipleFiles}} |
519 |
| - placeholder="{{placeholder}}" |
520 |
| - /> |
521 |
| - <button class="clear-button">×</button> |
522 |
| - <p class='{{errorId}} error-hidden'> |
523 |
| - This field is required |
524 |
| - </p> |
| 446 | + <div class='inputs-wrapper'> |
| 447 | + {{#each formFields}} |
| 448 | + {{#if isMultiSelect}} |
| 449 | + <div> |
| 450 | + <label class='form-label {{inputRequired}}'>{{label}}</label> |
| 451 | + <div class='multiselect {{inputRequired}}' id='{{id}}'> |
| 452 | + {{#each multiSelectOptions}} |
| 453 | + <div class='multiselect-option'> |
| 454 | + <input type='checkbox' class='multiselect-checkbox' id='{{id}}' /> |
| 455 | + <label for='{{id}}'>{{label}}</label> |
| 456 | + </div> |
| 457 | + {{/each}} |
525 | 458 | </div>
|
526 |
| - {{/if}} |
527 |
| - |
528 |
| - {{#if isInput}} |
529 |
| - <div class='form-group'> |
530 |
| - <label class='form-label {{inputRequired}}' for='{{id}}'>{{label}}</label> |
531 |
| - <input |
532 |
| - class='form-input {{inputRequired}}' |
533 |
| - type='{{type}}' |
534 |
| - id='{{id}}' |
535 |
| - name='{{id}}' |
536 |
| - value="{{defaultValue}}" |
537 |
| - placeholder="{{placeholder}}" |
538 |
| - /> |
539 |
| - <p class='{{errorId}} error-hidden'> |
540 |
| - This field is required |
541 |
| - </p> |
| 459 | + <p class='{{errorId}} error-hidden'> |
| 460 | + This field is required |
| 461 | + </p> |
| 462 | + </div> |
| 463 | + {{/if}} |
| 464 | + |
| 465 | + {{#if isSelect}} |
| 466 | + <div class='form-group'> |
| 467 | + <label class='form-label {{inputRequired}}' for='{{id}}'>{{label}}</label> |
| 468 | + <div class='select-input'> |
| 469 | + <select id='{{id}}' name='{{id}}' class='{{inputRequired}}'> |
| 470 | + <option value='' disabled selected>Select an option ...</option> |
| 471 | + {{#each selectOptions}} |
| 472 | + <option value='{{this}}'>{{this}}</option> |
| 473 | + {{/each}} |
| 474 | + </select> |
542 | 475 | </div>
|
543 |
| - {{/if}} |
544 |
| - {{/each}} |
545 |
| - </div> |
546 |
| - |
547 |
| - <button id='submit-btn' type='submit'> |
548 |
| - <span><svg |
549 |
| - xmlns='http://www.w3.org/2000/svg' |
550 |
| - height='18px' |
551 |
| - viewBox='0 0 512 512' |
552 |
| - > |
553 |
| - <path |
554 |
| - d='M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z' |
| 476 | + <p class='{{errorId}} error-hidden'> |
| 477 | + This field is required |
| 478 | + </p> |
| 479 | + </div> |
| 480 | + {{/if}} |
| 481 | + |
| 482 | + {{#if isHtml}} |
| 483 | + <div class="form-group html"> |
| 484 | + {{{html}}} |
| 485 | + <input type="hidden" id="{{id}}" name="{{id}}" value="{{html}}" /> |
| 486 | + </div> |
| 487 | + {{/if}} |
| 488 | + |
| 489 | + {{#if isHidden}} |
| 490 | + <input type="hidden" id="{{id}}" name="{{id}}" value="{{hiddenValue}}" /> |
| 491 | + {{/if}} |
| 492 | + |
| 493 | + {{#if isTextarea}} |
| 494 | + <div class='form-group'> |
| 495 | + <label class='form-label {{inputRequired}}' for='{{id}}'>{{label}}</label> |
| 496 | + <textarea |
| 497 | + class='form-input {{inputRequired}}' |
| 498 | + id='{{id}}' |
| 499 | + name='{{id}}' |
| 500 | + placeholder="{{placeholder}}" |
| 501 | + >{{defaultValue}}</textarea> |
| 502 | + <p class='{{errorId}} error-hidden'> |
| 503 | + This field is required |
| 504 | + </p> |
| 505 | + </div> |
| 506 | + {{/if}} |
| 507 | + |
| 508 | + {{#if isFileInput}} |
| 509 | + <div class='form-group file-input-wrapper'> |
| 510 | + <label class='form-label {{inputRequired}}' for='{{id}}'>{{label}}</label> |
| 511 | + <input |
| 512 | + class='form-input {{inputRequired}}' |
| 513 | + type='file' |
| 514 | + id='{{id}}' |
| 515 | + name='{{id}}' |
| 516 | + accept='{{acceptFileTypes}}' |
| 517 | + {{multipleFiles}} |
| 518 | + placeholder="{{placeholder}}" |
| 519 | + /> |
| 520 | + <button class="clear-button">×</button> |
| 521 | + <p class='{{errorId}} error-hidden'> |
| 522 | + This field is required |
| 523 | + </p> |
| 524 | + </div> |
| 525 | + {{/if}} |
| 526 | + |
| 527 | + {{#if isInput}} |
| 528 | + <div class='form-group'> |
| 529 | + <label class='form-label {{inputRequired}}' for='{{id}}'>{{label}}</label> |
| 530 | + <input |
| 531 | + class='form-input {{inputRequired}}' |
| 532 | + type='{{type}}' |
| 533 | + id='{{id}}' |
| 534 | + name='{{id}}' |
| 535 | + value="{{defaultValue}}" |
| 536 | + placeholder="{{placeholder}}" |
555 | 537 | />
|
556 |
| - </svg></span> |
557 |
| - {{ buttonLabel }} |
558 |
| - </button> |
559 |
| - </form> |
560 |
| - {{else}} |
561 |
| - <div class='card'> |
562 |
| - <div class='form-header'> |
563 |
| - {{#if testRun}} |
564 |
| - <h1>Please add at least one field to your form</h1> |
565 |
| - {{else}} |
566 |
| - <h1>Problem loading form</h1> |
567 |
| - <p> |
568 |
| - This usually occurs if the n8n workflow serving this form is deactivated or no |
569 |
| - longer exist |
570 |
| - </p> |
| 538 | + <p class='{{errorId}} error-hidden'> |
| 539 | + This field is required |
| 540 | + </p> |
| 541 | + </div> |
571 | 542 | {{/if}}
|
572 |
| - </div> |
| 543 | + {{/each}} |
573 | 544 | </div>
|
574 |
| - {{/if}} |
| 545 | + |
| 546 | + <button id='submit-btn' type='submit'> |
| 547 | + <span><svg |
| 548 | + xmlns='http://www.w3.org/2000/svg' |
| 549 | + height='18px' |
| 550 | + viewBox='0 0 512 512' |
| 551 | + > |
| 552 | + <path |
| 553 | + d='M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z' |
| 554 | + /> |
| 555 | + </svg></span> |
| 556 | + {{ buttonLabel }} |
| 557 | + </button> |
| 558 | + </form> |
575 | 559 |
|
576 | 560 | <div class='card' id='submitted-form' style='display: none;'>
|
577 | 561 | <div class='form-header'>
|
|
0 commit comments