1261
1261
}
1262
1262
1263
1263
.success-message {
1264
- text-align : center;
1265
- padding : 2rem ;
1266
- background : rgba (76 , 175 , 80 , 0.1 );
1267
- border : 2px solid rgba (76 , 175 , 80 , 0.5 );
1268
- border-radius : 20px ;
1269
- color : # 2e7d32 ;
1270
- animation : fadeInScale 0.5s ease;
1271
- margin-top : 1.5rem ;
1272
- box-shadow : 0 4px 15px rgba (76 , 175 , 80 , 0.2 );
1264
+ text-align : center !important ;
1265
+ padding : 2rem !important ;
1266
+ background : # d4edda !important ;
1267
+ border : 2px solid # 4caf50 !important ;
1268
+ border-radius : 20px !important ;
1269
+ color : # 155724 !important ;
1270
+ margin-top : 1.5rem !important ;
1271
+ box-shadow : 0 8px 25px rgba (76 , 175 , 80 , 0.3 ) !important ;
1272
+ width : 100% !important ;
1273
+ max-width : 600px !important ;
1274
+ z-index : 9999 !important ;
1275
+ position : relative !important ;
1276
+ display : none !important ;
1277
+ font-weight : 600 !important ;
1273
1278
}
1274
1279
1275
1280
.success-message i {
@@ -1955,7 +1960,7 @@ <h2 class="about-title mb-2">About Us</h2>
1955
1960
</ div >
1956
1961
</ section >
1957
1962
<!-- Our Work section ends here -->
1958
- <!-- Feedback & Reviews section starts here -->
1963
+ <!-- Feedback & Reviews section starts here -->
1959
1964
< section class ="feedback-section py-5 " id ="feedback ">
1960
1965
< div class ="container d-flex flex-column align-items-center ">
1961
1966
< div class ="feedback-content ">
@@ -1965,7 +1970,7 @@ <h2 class="feedback-title text-center mb-3">Feedback & Reviews</h2>
1965
1970
</ p >
1966
1971
1967
1972
< div class ="feedback-form-container ">
1968
- < form id ="feedbackForm " class ="feedback-form ">
1973
+ < form id ="feedbackForm " class ="feedback-form " onsubmit =" return showSuccessMessage(event) " >
1969
1974
< div class ="form-row ">
1970
1975
< div class ="form-group ">
1971
1976
< input type ="text " id ="userName " name ="userName " placeholder ="Your Name * " required class ="form-input ">
@@ -1978,20 +1983,20 @@ <h2 class="feedback-title text-center mb-3">Feedback & Reviews</h2>
1978
1983
< textarea id ="userFeedback " name ="userFeedback " placeholder ="Share your thoughts, suggestions, or experience with us... " rows ="4 " required class ="form-textarea "> </ textarea >
1979
1984
</ div >
1980
1985
< div class ="form-buttons ">
1981
- < button type ="submit " class ="btn btn-submit ">
1986
+ < button type ="submit " class ="btn btn-submit " onclick =" showSuccessMessage(event) " >
1982
1987
< i class ="fas fa-paper-plane "> </ i > Submit
1983
1988
</ button >
1984
- < button type ="button " class ="btn btn-cancel " id =" cancelBtn ">
1989
+ < button type ="button " class ="btn btn-cancel " onclick =" clearForm() ">
1985
1990
< i class ="fas fa-times "> </ i > Cancel
1986
1991
</ button >
1987
1992
</ div >
1988
1993
</ form >
1989
1994
</ div >
1990
1995
1991
- <!-- Success Message -->
1992
- < div id ="successMessage " class =" success-message " style ="display: none; ">
1993
- < i class ="fas fa-check-circle "> </ i >
1994
- < p > Submitted successfully! Thank you for your feedback.</ p >
1996
+ <!-- Success Message BELOW Form Container -->
1997
+ < div id ="successMessage " style ="display: none; text-align: center; padding: 20px; margin-top: 20px; background: #d4edda; border: 2px solid #4caf50; border-radius: 10px; color: #155724; font-weight: bold; max-width: 600px ; ">
1998
+ < i class ="fas fa-check-circle " style =" color: #4caf50; font-size: 24px; margin-bottom: 10px; " > </ i >
1999
+ < p style =" margin: 0; font-size: 16px; " > Thank you for your feedback! Submitted successfully .</ p >
1995
2000
</ div >
1996
2001
</ div >
1997
2002
</ div >
@@ -2178,56 +2183,49 @@ <h5 class="footer-title">Get In Touch</h5>
2178
2183
interval : 4000 , // auto-slide time
2179
2184
wrap : true , // enables infinite loop
2180
2185
} ) ;
2181
- // Feedback Form Functionality
2182
- document . addEventListener ( "DOMContentLoaded" , function ( ) {
2183
- const feedbackForm = document . getElementById ( 'feedbackForm' ) ;
2184
- const successMessage = document . getElementById ( 'successMessage' ) ;
2185
- const cancelBtn = document . getElementById ( 'cancelBtn' ) ;
2186
- const formContainer = document . querySelector ( '.feedback-form-container' ) ;
2187
-
2188
- // Form submission handler
2189
- feedbackForm . addEventListener ( 'submit' , function ( e ) {
2190
- e . preventDefault ( ) ;
2191
-
2192
- // Get form data
2193
- const formData = {
2194
- name : document . getElementById ( 'userName' ) . value ,
2195
- email : document . getElementById ( 'userEmail' ) . value ,
2196
- feedback : document . getElementById ( 'userFeedback' ) . value ,
2197
- timestamp : new Date ( ) . toISOString ( ) ,
2198
- id : Date . now ( ) // Simple ID generation
2199
- } ;
2200
-
2186
+ // SIMPLE FEEDBACK FUNCTIONS - FORM STAYS VISIBLE
2187
+ function showSuccessMessage ( event ) {
2188
+ event . preventDefault ( ) ;
2189
+
2190
+ // Get form values
2191
+ var name = document . getElementById ( 'userName' ) . value ;
2192
+ var email = document . getElementById ( 'userEmail' ) . value ;
2193
+ var feedback = document . getElementById ( 'userFeedback' ) . value ;
2194
+
2195
+ // Check if all fields are filled
2196
+ if ( name && email && feedback ) {
2201
2197
// Save to localStorage
2202
- let existingFeedbacks = JSON . parse ( localStorage . getItem ( 'growcraft_feedbacks' ) ) || [ ] ;
2203
- existingFeedbacks . push ( formData ) ;
2204
- localStorage . setItem ( 'growcraft_feedbacks' , JSON . stringify ( existingFeedbacks ) ) ;
2198
+ var data = {
2199
+ name : name ,
2200
+ email : email ,
2201
+ feedback : feedback ,
2202
+ timestamp : new Date ( ) . toISOString ( )
2203
+ } ;
2205
2204
2206
- // Hide form container and show success message
2207
- formContainer . style . display = 'none' ;
2208
- successMessage . style . display = 'block' ;
2205
+ var feedbacks = JSON . parse ( localStorage . getItem ( 'growcraft_feedbacks' ) || '[]' ) ;
2206
+ feedbacks . push ( data ) ;
2207
+ localStorage . setItem ( 'growcraft_feedbacks' , JSON . stringify ( feedbacks ) ) ;
2209
2208
2210
- // Scroll to success message
2211
- successMessage . scrollIntoView ( { behavior : 'smooth' , block : 'center' } ) ;
2209
+ // KEEP FORM VISIBLE - Just show success message below
2210
+ document . getElementById ( 'successMessage' ) . style . display = 'block' ;
2212
2211
2213
- // Auto-reset form after 4 seconds
2214
- setTimeout ( ( ) => {
2215
- resetFeedbackForm ( ) ;
2212
+ // Reset form fields and hide success message after 4 seconds
2213
+ setTimeout ( function ( ) {
2214
+ document . getElementById ( 'successMessage' ) . style . display = 'none' ;
2215
+ document . getElementById ( 'feedbackForm' ) . reset ( ) ;
2216
2216
} , 4000 ) ;
2217
- } ) ;
2218
-
2219
- // Cancel button handler
2220
- cancelBtn . addEventListener ( 'click' , function ( ) {
2221
- resetFeedbackForm ( ) ;
2222
- } ) ;
2223
-
2224
- // Reset form function
2225
- function resetFeedbackForm ( ) {
2226
- feedbackForm . reset ( ) ;
2227
- formContainer . style . display = 'block' ;
2228
- successMessage . style . display = 'none' ;
2217
+
2218
+ } else {
2219
+ alert ( 'Please fill all required fields!' ) ;
2229
2220
}
2230
- } ) ;
2221
+
2222
+ return false ;
2223
+ }
2224
+
2225
+ function clearForm ( ) {
2226
+ document . getElementById ( 'feedbackForm' ) . reset ( ) ;
2227
+ document . getElementById ( 'successMessage' ) . style . display = 'none' ;
2228
+ }
2231
2229
</ script >
2232
2230
< script >
2233
2231
document . addEventListener ( "DOMContentLoaded" , function ( ) {
0 commit comments