File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,19 +112,13 @@ <h1>Contact Us</h1>
112112 < form id ="contact-form ">
113113 <!-- <label for="name">Name:</label> -->
114114 < input type ="text " id ="name " name ="name " required placeholder ="Name: ">
115-
116-
117-
115+
118116 <!-- <label for="email">Email:</label> -->
119117 < input type ="email " id ="email " name ="email " required placeholder ="Email: ">
120-
121-
122-
118+
123119 <!-- <label for="comment">Comment:</label> -->
124- < textarea id ="comment " name ="comment " required placeholder ="Comment: " > </ textarea >
125-
126-
127-
120+ < textarea id ="comment " name ="comment " required placeholder ="Comment: "> </ textarea >
121+
128122 < label for ="rating " id ="rate "> Rating:</ label >
129123 < div id ="rating ">
130124 < span class ="star " data-value ="1 "> ★</ span >
@@ -133,11 +127,12 @@ <h1>Contact Us</h1>
133127 < span class ="star " data-value ="4 "> ★</ span >
134128 < span class ="star " data-value ="5 "> ★</ span >
135129 </ div >
136-
130+
137131 < button type ="submit " id ="button "> Submit</ button >
132+ < p id ="thank-you-message " style ="color: white; display: none; "> Thank you !!< br > We will connect soon.</ p >
138133 </ form >
139- </ div >
140- </ div >
134+ </ div >
135+ </ div >
141136 < div class ="marg ">
142137 < div class ="footer ">
143138 < p class ="iconsclass mm ">
Original file line number Diff line number Diff line change @@ -11,12 +11,17 @@ document.addEventListener("DOMContentLoaded", () => {
1111 }
1212 } ) ;
1313 } ) ;
14+ } ) ;
15+ document . getElementById ( 'contact-form' ) . addEventListener ( 'submit' , function ( event ) {
16+ event . preventDefault ( ) ;
17+
18+ const thankYouMessage = document . getElementById ( 'thank-you-message' ) ;
19+ thankYouMessage . style . display = 'block' ;
20+
21+ setTimeout ( function ( )
22+ {
23+ thankYouMessage . style . display = 'none' ;
24+ document . getElementById ( 'contact-form' ) . reset ( ) ;
25+ } , 3000 ) ;
1426
15- const form = document . getElementById ( "contact-form" ) ;
16- form . addEventListener ( "submit" , ( e ) => {
17- e . preventDefault ( ) ;
18- alert (
19- `Name: ${ form . name . value } \nEmail: ${ form . email . value } \nComment: ${ form . comment . value } \nRating: ${ selectedRating } stars`
20- ) ;
21- } ) ;
2227} ) ;
You can’t perform that action at this time.
0 commit comments