|
1 | 1 | <div class="overlay">
|
2 | 2 | <div class="overlay-content">
|
3 | 3 | <button class="form-close" (click)="hideContactForm.emit(false)">x</button>
|
4 |
| - <form class="contact-form" [formGroup]="contactForm" novalidate (ngSubmit)="sendtosuperuser(contactForm.value); showSubmit()" |
5 |
| - method="POST" action="https://formspree.io/office@fossasia.org"> |
| 4 | + <form |
| 5 | + class="contact-form" |
| 6 | + [formGroup]="contactForm" |
| 7 | + novalidate |
| 8 | + (ngSubmit)="sendtosuperuser(contactForm.value); showSubmit()" |
| 9 | + method="POST" |
| 10 | + action="https://formspree.io/office@fossasia.org" |
| 11 | + > |
6 | 12 | <fieldset>
|
7 | 13 | <legend>Contact Form</legend>
|
8 |
| - <div class="form-group"> |
| 14 | + <div class="form-group getRawValue"> |
9 | 15 | <label class="form-label" for="name">*Name </label>
|
10 |
| - <input type="text" formControlName="name" id="name" placeholder="Your name" name="name"> |
11 |
| - <div class="validators"><small *ngIf="!(contactForm.controls.name.valid || (contactForm.controls.name.pristine && !submitted))"> |
12 |
| - Name is required |
13 |
| - </small></div> |
| 16 | + <input |
| 17 | + type="text" |
| 18 | + formControlName="name" |
| 19 | + id="name" |
| 20 | + placeholder="Your name" |
| 21 | + name="name" |
| 22 | + /> |
| 23 | + <div class="validators"> |
| 24 | + <small |
| 25 | + *ngIf=" |
| 26 | + !( |
| 27 | + contactForm.controls.name.valid || |
| 28 | + (contactForm.controls.name.pristine && !submitted) |
| 29 | + ) |
| 30 | + " |
| 31 | + > |
| 32 | + Name is required |
| 33 | + </small> |
| 34 | + </div> |
14 | 35 | </div>
|
15 | 36 | <div class="form-group">
|
16 | 37 | <label class="form-label" for="email">*Email </label>
|
17 |
| - <input type="email" formControlName="email" id="email" placeholder="xyz@example.com" name="email"> |
18 |
| - <div class="validators"><small *ngIf="!(contactForm.controls.email.valid || (contactForm.controls.email.pristine && !submitted))"> |
19 |
| - Valid Email is required |
20 |
| - </small> </div> |
| 38 | + <input |
| 39 | + type="email" |
| 40 | + formControlName="email" |
| 41 | + id="email" |
| 42 | + placeholder="xyz@example.com" |
| 43 | + name="email" |
| 44 | + /> |
| 45 | + <div class="validators"> |
| 46 | + <small |
| 47 | + *ngIf=" |
| 48 | + !( |
| 49 | + contactForm.controls.email.valid || |
| 50 | + (contactForm.controls.email.pristine && !submitted) |
| 51 | + ) |
| 52 | + " |
| 53 | + > |
| 54 | + Valid Email is required |
| 55 | + </small> |
| 56 | + </div> |
21 | 57 | </div>
|
22 | 58 | <div class="form-group">
|
23 | 59 | <label class="form-label" for="telephone">*Mobile Number </label>
|
24 | 60 | <span class="telephonegroup">
|
25 |
| - <select formControlName="countrycode" id="telephone" name="countrycode" placeholder="Country Code" [(ngModel)]="selectedValue" > |
26 |
| - <option *ngFor="let c of countries" [value]="c.code">{{c.name}} (+{{c.code}})</option> |
27 |
| -</select> - |
28 |
| - <input type="tel" formControlName="telephone" id="telephone" placeholder="Mobile Number" name="telephone"> |
29 |
| - </span> |
30 |
| - <div class="validators"><small *ngIf="!(contactForm.controls.telephone.valid || (contactForm.controls.telephone.pristine && !submitted))"> |
31 |
| - Valid Mobile Number is required. |
32 |
| - </small> </div> |
| 61 | + <select |
| 62 | + formControlName="countrycode" |
| 63 | + id="telephone" |
| 64 | + name="countrycode" |
| 65 | + placeholder="Country Code" |
| 66 | + [(ngModel)]="selectedValue" |
| 67 | + > |
| 68 | + <option *ngFor="let c of countries" [value]="c.code" |
| 69 | + >{{ c.name }} (+{{ c.code }})</option |
| 70 | + > |
| 71 | + </select> |
| 72 | + - |
| 73 | + <input |
| 74 | + type="tel" |
| 75 | + formControlName="telephone" |
| 76 | + id="telephone" |
| 77 | + placeholder="Mobile Number" |
| 78 | + name="telephone" |
| 79 | + /> |
| 80 | + </span> |
| 81 | + <div class="validators"> |
| 82 | + <small |
| 83 | + *ngIf=" |
| 84 | + !( |
| 85 | + contactForm.controls.telephone.valid || |
| 86 | + (contactForm.controls.telephone.pristine && !submitted) |
| 87 | + ) |
| 88 | + " |
| 89 | + > |
| 90 | + Valid Mobile Number is required. |
| 91 | + </small> |
| 92 | + </div> |
33 | 93 | </div>
|
34 | 94 | <div class="form-group">
|
35 | 95 | <label class="form-label" for="input">*Message</label>
|
36 |
| - <textarea rows="30" cols="8" type="text" formControlName="message" id="input" name="message" placeholder="Minimum 100 characters"></textarea> |
37 |
| - <div class="validators"><small *ngIf="!(contactForm.controls.message.valid || (contactForm.controls.message.pristine && !submitted))"> |
38 |
| - Describe more with Minimum 100 characters. |
39 |
| - </small> </div> |
| 96 | + <textarea |
| 97 | + rows="30" |
| 98 | + cols="8" |
| 99 | + type="text" |
| 100 | + formControlName="message" |
| 101 | + id="input" |
| 102 | + name="message" |
| 103 | + placeholder="Minimum 100 characters" |
| 104 | + ></textarea> |
| 105 | + <div class="validators"> |
| 106 | + <small |
| 107 | + *ngIf=" |
| 108 | + !( |
| 109 | + contactForm.controls.message.valid || |
| 110 | + (contactForm.controls.message.pristine && !submitted) |
| 111 | + ) |
| 112 | + " |
| 113 | + > |
| 114 | + Describe more with Minimum 100 characters. |
| 115 | + </small> |
| 116 | + </div> |
40 | 117 | </div>
|
41 | 118 | <div class="form-group">
|
42 | 119 | <small>*All fields are mandatory</small>
|
43 |
| - <button type="submit" [disabled]="!contactForm.valid" value="submit">Submit<input type="hidden" name="_next" value="/contact" /></button> |
44 |
| - <small *ngIf="submitted && contactForm.valid ">Your Form has been submitted</small> |
| 120 | + <button type="submit" [disabled]="!contactForm.valid" value="submit"> |
| 121 | + Submit<input type="hidden" name="_next" value="/contact" /> |
| 122 | + </button> |
| 123 | + <small *ngIf="submitted && contactForm.valid" |
| 124 | + >Your Form has been submitted</small |
| 125 | + > |
45 | 126 | </div>
|
46 | 127 | </fieldset>
|
47 | 128 | </form>
|
|
0 commit comments