@@ -44,15 +44,27 @@ <h2 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">
44
44
45
45
function onFormSubmit ( ) {
46
46
if ( cancel_subscription_form_submitted ) {
47
- window . location = "https://octabyte.io" ;
47
+ const message = document . getElementById ( "message" ) ;
48
+ const submitBtn = document . getElementById ( "submit-btn" ) ;
49
+
50
+ submitBtn . style . display = "none" ;
51
+ message . style . display = "block" ;
52
+
53
+ setTimeout ( ( ) => {
54
+ window . location = "https://octabyte.io" ;
55
+ } , 3000 ) ;
48
56
}
49
57
}
50
58
51
59
function submitForm ( e ) {
52
60
const errorMessage = document . getElementById ( "error-message" ) ;
53
61
const serviceInput = document . getElementById ( "service-name" ) ;
54
62
55
- if ( serviceInput . value . trim ( ) != serviceName ) {
63
+ errorMessage . style . display = "none" ;
64
+
65
+ if (
66
+ serviceInput . value . trim ( ) . toLowerCase ( ) != serviceName . toLowerCase ( )
67
+ ) {
56
68
errorMessage . style . display = "block" ;
57
69
e . preventDefault ( ) ;
58
70
}
@@ -99,7 +111,11 @@ <h2 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">
99
111
100
112
< div class ="mt-10 ">
101
113
< p id ="error-message " class ="mt-2 text-sm text-red-500 hidden ">
102
- Please enter a valid service name.
114
+ Please enter a same service name to confirm.
115
+ </ p >
116
+ < p id ="message " class ="mt-2 text-sm text-green-700 ">
117
+ Your request to cancel the subscription has been successfully sent.
118
+ Redirecting to octabyte.io...
103
119
</ p >
104
120
< button
105
121
onclick ="submitForm(event) "
0 commit comments