|
| 1 | +@page |
| 2 | +@model AccordionUGSamples.Pages.CreateWizardModel |
| 3 | +@{ |
| 4 | +} |
| 5 | + |
| 6 | +<div class="accordion-control-section"> |
| 7 | + <div class="accordion-control-section"> |
| 8 | + <div class='template_title'> Online Shopping Payment Module</div> |
| 9 | + <ejs-accordion id="element" created="created" expanding="expand"> |
| 10 | + <e-content-template> |
| 11 | + <div> |
| 12 | + <div> |
| 13 | + Sign In |
| 14 | + </div> |
| 15 | + <div> |
| 16 | + <div id="Sign_In_Form" style="padding:10px"> |
| 17 | + <form id="formId"> |
| 18 | + <div class="form-group"> |
| 19 | + <div class="e-float-input"> |
| 20 | + <input type="text" id="email" name="Email" required="" /> |
| 21 | + <span class="e-float-line"></span> |
| 22 | + <label class="e-float-text" for="email">Email</label> |
| 23 | + </div> |
| 24 | + <div class="e-float-input"> |
| 25 | + <input class="e-input" id="password" type="password" name="Password" required="" /> |
| 26 | + <span class="e-float-line"></span> |
| 27 | + <label class="e-float-text" for="password">Password</label> |
| 28 | + </div> |
| 29 | + </div> |
| 30 | + </form> |
| 31 | + <div style="text-align: center"> |
| 32 | + <button class='e-btn' id="Continue_Btn">Continue</button> |
| 33 | + <div id="err1">* Please fill all fields</div> |
| 34 | + </div> |
| 35 | + </div> |
| 36 | + </div> |
| 37 | + </div> |
| 38 | + <div> |
| 39 | + <div> |
| 40 | + Delivery Address |
| 41 | + </div> |
| 42 | + <div> |
| 43 | + <div id="Address_Fill" style="padding:10px"> |
| 44 | + <form id="formId_Address"> |
| 45 | + <div class="form-group"> |
| 46 | + <div class="e-float-input"> |
| 47 | + <input type="text" id="name" name="Name" required="" /> |
| 48 | + <span class="e-float-line"></span> |
| 49 | + <label class="e-float-text" for="name">Name</label> |
| 50 | + </div> |
| 51 | + </div> |
| 52 | + <div class="form-group"> |
| 53 | + <div class="e-float-input"> |
| 54 | + <input type="text" id="address" name="Address" required="" /> |
| 55 | + <span class="e-float-line"></span> |
| 56 | + <label class="e-float-text" for="address">Address</label> |
| 57 | + </div> |
| 58 | + </div> |
| 59 | + <div class="form-group"> |
| 60 | + <ejs-numerictextbox id="mobile" placeholder="Mobile" floatLabelType="Auto" format=0 showSpinButton="false"></ejs-numerictextbox> |
| 61 | + </div> |
| 62 | + </form> |
| 63 | + <div style="text-align: center"> |
| 64 | + <button class='e-btn' id="Continue_BtnAdr">Continue</button> |
| 65 | + <div id="err2">* Please fill all fields</div> |
| 66 | + </div> |
| 67 | + </div> |
| 68 | + </div> |
| 69 | + </div> |
| 70 | + <div> |
| 71 | + <div> |
| 72 | + Card Details |
| 73 | + </div> |
| 74 | + <div> |
| 75 | + <div id="Card_Fill" style="padding:10px"> |
| 76 | + <div class="col-xs-6 col-sm-6 col-lg-6 col-md-6"> |
| 77 | + <div class="form-group"> |
| 78 | + <ejs-numerictextbox id="cardNo" placeholder="Card No" floatLabelType="Auto" format=0 showSpinButton="false"></ejs-numerictextbox> |
| 79 | + </div> |
| 80 | + </div> |
| 81 | + <div class="col-xs-6 col-sm-6 col-lg-6 col-md-6"> |
| 82 | + <div class="form-group"> |
| 83 | + <div class="e-float-input"> |
| 84 | + <input type="text" id="cardHolder" name="cardHolder" required="" /> |
| 85 | + <span class="e-float-line"></span> |
| 86 | + <label class="e-float-text" for="cardHolder">CardHolder Name</label> |
| 87 | + </div> |
| 88 | + </div> |
| 89 | + </div> |
| 90 | + <div class="col-xs-6 col-sm-6 col-lg-6 col-md-6"> |
| 91 | + <ejs-datepicker id="expiry" width="100%" placeholder="Expiry Date" format="MM/yyyy" readonly="false"></ejs-datepicker> |
| 92 | + </div> |
| 93 | + <div class="col-xs-6 col-sm-6 col-lg-6 col-md-6"> |
| 94 | + <div class="form-group"> |
| 95 | + <ejs-numerictextbox id="CVV" placeholder="CVV" floatLabelType="Auto" format=0 showSpinButton="false"></ejs-numerictextbox> |
| 96 | + </div> |
| 97 | + </div> |
| 98 | + </div> |
| 99 | + <div style="text-align: center"> |
| 100 | + <button class='e-btn' id="Back_Btn">Back</button> |
| 101 | + <button class='e-btn' id="Save_Btn">Save</button> |
| 102 | + <div id="err3">* Please fill all fields</div> |
| 103 | + </div> |
| 104 | + </div> |
| 105 | + </div> |
| 106 | + </e-content-template> |
| 107 | + </ejs-accordion> |
| 108 | + </div> |
| 109 | + <div> |
| 110 | + <ejs-dialog id="alertDialog" header="Alert" target="#element" showCloseIcon="true" width="250" isModal="true" created="dlgCreated" content="" visible="false"></ejs-dialog> |
| 111 | + </div> |
| 112 | +</div> |
| 113 | + |
| 114 | +<style> |
| 115 | + .accordion-control-section { |
| 116 | + margin: 0 10% 0 10%; |
| 117 | + } |
| 118 | +
|
| 119 | + @@media screen and (max-width: 768px) { |
| 120 | + .accordion-control-section { |
| 121 | + margin: 0; |
| 122 | + } |
| 123 | + } |
| 124 | +
|
| 125 | + #err1, #err2, #err3 { |
| 126 | + display: none; |
| 127 | + color: red; |
| 128 | + margin-top: 10px; |
| 129 | + font-weight: 500; |
| 130 | + } |
| 131 | +
|
| 132 | + #err1.show, |
| 133 | + #err2.show, |
| 134 | + #err3.show { |
| 135 | + display: block; |
| 136 | + } |
| 137 | +
|
| 138 | + .e-dialog { |
| 139 | + max-height: 300px !important; |
| 140 | + } |
| 141 | +
|
| 142 | + .template_title { |
| 143 | + text-align: center; |
| 144 | + padding: 10px 0; |
| 145 | + margin: 20px 0; |
| 146 | + text-overflow: ellipsis; |
| 147 | + font-weight: bold; |
| 148 | + font-size: 16px; |
| 149 | + } |
| 150 | +</style> |
| 151 | + |
| 152 | +<script> |
| 153 | + var success = 'Your payment successfully processed'; |
| 154 | + var email_alert = 'Enter valid email address'; |
| 155 | + var mobile_alert = 'Mobile number length should be 10'; |
| 156 | + var card_alert = 'Card number length should be 16'; |
| 157 | + var cvv_alert = 'CVV number length should be 3'; |
| 158 | + var alertDlg; |
| 159 | + var acrdnObj; |
| 160 | + function dlgCreated() { |
| 161 | + alertDlg = document.getElementById("alertDialog").ej2_instances[0]; |
| 162 | + alertDlg.buttons = [{ |
| 163 | + buttonModel: { content: "Ok", isPrimary: true }, |
| 164 | + click: function () { |
| 165 | + alertDlg.hide(); |
| 166 | + if (acrdnObj.expandedIndices[0] === 2 && alertDlg.content === success) { |
| 167 | + acrdnObj.enableItem(0, true); |
| 168 | + acrdnObj.enableItem(1, false); |
| 169 | + acrdnObj.enableItem(2, false); |
| 170 | + acrdnObj.expandItem(true, 0); |
| 171 | + } |
| 172 | + } |
| 173 | + }]; |
| 174 | + alertDlg.dataBind(); |
| 175 | + alertDlg.hide(); |
| 176 | + } |
| 177 | + function checkMail(mail) { |
| 178 | + if (/^\w+([\.-]?\w+)*@@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail)) { |
| 179 | + return (true); |
| 180 | + } else { |
| 181 | + alertDlg.content = email_alert; |
| 182 | + alertDlg.show(); |
| 183 | + return (false); |
| 184 | + } |
| 185 | + } |
| 186 | + function checkMobile(mobile) { |
| 187 | + if (mobile.match(/^\d{10}$/)) { |
| 188 | + return (true); |
| 189 | + } else { |
| 190 | + alertDlg.content = mobile_alert; |
| 191 | + alertDlg.show(); |
| 192 | + return (false); |
| 193 | + } |
| 194 | + } |
| 195 | + function checkCardNo(cardNo) { |
| 196 | + if (cardNo.match(/^\d{16}$/)) { |
| 197 | + return (true); |
| 198 | + } else { |
| 199 | + alertDlg.content = card_alert; |
| 200 | + alertDlg.show(); |
| 201 | + return (false); |
| 202 | + } |
| 203 | + } |
| 204 | + function checkCVV(cvv) { |
| 205 | + if (cvv.match(/^\d{3}$/)) { |
| 206 | + return (true); |
| 207 | + } else { |
| 208 | + alertDlg.content = cvv_alert; |
| 209 | + alertDlg.show(); |
| 210 | + return (false); |
| 211 | + } |
| 212 | + } |
| 213 | + function created(e) { |
| 214 | + acrdnObj = document.getElementById("element").ej2_instances[0]; |
| 215 | + acrdnObj.enableItem(1, false); |
| 216 | + acrdnObj.enableItem(2, false); |
| 217 | + } |
| 218 | + function expand(e) { |
| 219 | + if (e.name === 'expanding' && (e.index === 0)) { |
| 220 | + document.getElementById('Continue_Btn').onclick = (e) => { |
| 221 | + var email = document.getElementById('email'); |
| 222 | + var password = document.getElementById('password'); |
| 223 | + if (email.value !== '' && password.value !== '') { |
| 224 | + if (checkMail(email.value)) { |
| 225 | + email.value = password.value = ''; |
| 226 | + acrdnObj.enableItem(1, true); |
| 227 | + acrdnObj.enableItem(0, false); |
| 228 | + acrdnObj.expandItem(true, 1); |
| 229 | + } |
| 230 | + document.getElementById('err1').classList.remove('show'); |
| 231 | + } else { |
| 232 | + document.getElementById('err1').classList.add('show'); |
| 233 | + } |
| 234 | + }; |
| 235 | + } else if (e.name === 'expanding' && (e.index === 1)) { |
| 236 | + document.getElementById('Continue_BtnAdr').onclick = (e) => { |
| 237 | + var name = document.getElementById('name'); |
| 238 | + var address = document.getElementById('address'); |
| 239 | + var mobile = document.getElementById('mobile'); |
| 240 | + if ((name.value !== '') && (address.value !== '') && (mobile.value !== '')) { |
| 241 | + if (checkMobile(mobile.value)) { |
| 242 | + acrdnObj.enableItem(2, true); |
| 243 | + acrdnObj.enableItem(1, false); |
| 244 | + acrdnObj.expandItem(true, 2); |
| 245 | + } |
| 246 | + document.getElementById('err2').classList.remove('show'); |
| 247 | + } else { |
| 248 | + document.getElementById('err2').classList.add('show'); |
| 249 | + } |
| 250 | + }; |
| 251 | + } else if (e.name === 'expanding' && (e.index === 2)) { |
| 252 | + document.getElementById('Back_Btn').onclick = (e) => { |
| 253 | + acrdnObj.enableItem(1, true); |
| 254 | + acrdnObj.enableItem(2, false); |
| 255 | + acrdnObj.expandItem(true, 1); |
| 256 | + }; |
| 257 | + document.getElementById('Save_Btn').onclick = (e) => { |
| 258 | + var cardHolder = document.getElementById('cardHolder'); |
| 259 | + var expiry = document.getElementById('expiry'); |
| 260 | + var cardNo = document.getElementById('cardNo'); |
| 261 | + var cvv = document.getElementById('CVV'); |
| 262 | + if ((cardNo.value !== '') && (cardHolder.value !== '') && (expiry.value !== '') && (cvv.value !== '')) { |
| 263 | + if (checkCardNo(cardNo.value)) { |
| 264 | + if (checkCVV(cvv.value)) { |
| 265 | + alertDlg.content = success; |
| 266 | + alertDlg.show(); |
| 267 | + } |
| 268 | + } |
| 269 | + document.getElementById('err3').classList.remove('show'); |
| 270 | + } else { |
| 271 | + document.getElementById('err3').classList.add('show'); |
| 272 | + } |
| 273 | + }; |
| 274 | + } |
| 275 | + } |
| 276 | +</script> |
0 commit comments