Commit bf56a77 1 parent 8cf4ddd commit bf56a77 Copy full SHA for bf56a77
File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ <h2>Get A Free Quote Today!</h2>
93
93
</ div >
94
94
</ section >
95
95
96
- <!-- JavaScript for Form Submission Handling -->
96
+ <!-- JavaScript for Form Submission Handling and OTHER System Input Toggle -->
97
97
< script >
98
98
document . getElementById ( 'quote-form' ) . addEventListener ( 'submit' , function ( event ) {
99
99
event . preventDefault ( ) ; // Prevent default form submission
@@ -106,13 +106,24 @@ <h2>Get A Free Quote Today!</h2>
106
106
if ( response . ok ) {
107
107
alert ( 'SUCCESS! Your quote request has been sent.' ) ;
108
108
this . reset ( ) ;
109
+ document . getElementById ( 'other-system' ) . style . display = 'none' ; // Hide OTHER input after form reset
109
110
} else {
110
111
alert ( 'FAILED... Please try again later.' ) ;
111
112
}
112
113
} ) . catch ( error => {
113
114
alert ( 'FAILED... Please try again later.' ) ;
114
115
} ) ;
115
116
} ) ;
117
+
118
+ // JavaScript to toggle "Specify Other System" input
119
+ document . getElementById ( 'system' ) . addEventListener ( 'change' , function ( ) {
120
+ const otherSystemInput = document . getElementById ( 'other-system' ) ;
121
+ if ( this . value === 'OTHER' ) {
122
+ otherSystemInput . style . display = 'block' ;
123
+ } else {
124
+ otherSystemInput . style . display = 'none' ;
125
+ }
126
+ } ) ;
116
127
</ script >
117
128
118
129
</ body >
You can’t perform that action at this time.
0 commit comments