Revision 49747
Added by Sofia Baltzi over 6 years ago
register.jsp | ||
---|---|---|
63 | 63 |
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div> |
64 | 64 |
<div class="form-group"> |
65 | 65 |
<span class="msg_first_name_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your first name.</span> |
66 |
<input id="first_name" name="first_name" type="text" placeholder="First name (*)" class="form-control"></div> |
|
66 |
<input id="first_name" name="first_name" type="text" placeholder="First name (*)" class="form-control" value=${first_name}></div> |
|
67 |
<c:remove var="first_name" scope="session" /> |
|
67 | 68 |
<div class="form-group"> |
68 | 69 |
<span class="msg_last_name_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your last name.</span> |
69 |
<input id="last_name" name="last_name" type="text" placeholder="Last name (*)" class="form-control"></div> |
|
70 |
<input id="last_name" name="last_name" type="text" placeholder="Last name (*)" class="form-control" value=${last_name}></div> |
|
71 |
<c:remove var="last_name" scope="session" /> |
|
70 | 72 |
<div class="form-group"> |
71 |
<input id="organization" name="organization" type="text" placeholder="Affiliation / Organization:" class="form-control"></div> |
|
73 |
<input id="organization" name="organization" type="text" placeholder="Affiliation / Organization:" class="form-control" value=${organization}></div> |
|
74 |
<c:remove var="organization" scope="session" /> |
|
72 | 75 |
<div class="form-group"> |
73 | 76 |
<span class="msg_username_min_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Minimum username length 5 characters.</span> |
74 | 77 |
<span class="msg_username_max_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Maximum username lenght 150 characters.</span> |
75 | 78 |
<span class="msg_username_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your username.</span> |
76 | 79 |
<span id="username_server_error" class="uk-text-danger uk-text-small uk-float-left">${username_message}</span> |
77 | 80 |
<c:remove var="username_message" scope="session" /> |
78 |
<input id="username" name="username" type="text" placeholder="Username (*)" class="form-control"></div> |
|
81 |
<input id="username" name="username" type="text" placeholder="Username (*)" class="form-control" value=${username}></div> |
|
82 |
<c:remove var="username" scope="session" /> |
|
79 | 83 |
<div class="form-group"> |
80 | 84 |
<span class="msg_email_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your email.</span> |
81 | 85 |
<span class="msg_email_validation_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter a valid email.</span> |
82 | 86 |
<span class="msg_email_conf_error uk-text-danger uk-text-small uk-float-left" style="display:none">These emails don't match.</span> |
83 | 87 |
<span id="email_server_error" class="uk-text-danger uk-text-small uk-float-left">${email_message}</span> |
84 | 88 |
<c:remove var="email_message" scope="session" /> |
85 |
<input id="email" name="email" type="text" placeholder="Email (*)" class="form-control"></div> |
|
89 |
<input id="email" name="email" type="text" placeholder="Email (*)" class="form-control" value=${email}></div> |
|
90 |
<c:remove var="email" scope="session" /> |
|
86 | 91 |
<div class="form-group"> |
87 |
<input id="email_conf" name="email_conf" type="text" placeholder="Confirm email (*)" class="form-control"></div> |
|
92 |
<input id="email_conf" name="email_conf" type="text" placeholder="Confirm email (*)" class="form-control" value=${email_conf}></div> |
|
93 |
<c:remove var="email_conf" scope="session" /> |
|
88 | 94 |
<%--<div class="form-group">--%> |
89 | 95 |
<%--<span class="msg_password_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your password.</span>--%> |
90 | 96 |
<%--<span class="msg_pass_conf_error uk-text-danger uk-text-small uk-float-left" style="display:none">These passwords don't match.</span>--%> |
... | ... | |
222 | 228 |
}); |
223 | 229 |
|
224 | 230 |
|
225 |
// Run on page load |
|
226 |
window.onload = function() { |
|
231 |
// // Run on page load |
|
232 |
// window.onload = function() { |
|
233 |
// |
|
234 |
//// // If sessionStorage is storing default values (ex. name), exit the function and do not restore data |
|
235 |
//// if (sessionStorage.getItem('name') == "name") { |
|
236 |
//// return; |
|
237 |
//// } |
|
238 |
// |
|
239 |
// // If values are not blank, restore them to the fields |
|
240 |
// |
|
241 |
// var first_name = sessionStorage.getItem('first_name'); |
|
242 |
// if (first_name !== null) $('#first_name').val(first_name); |
|
243 |
// |
|
244 |
// var last_name = sessionStorage.getItem('last_name'); |
|
245 |
// if (last_name !== null) $('#last_name').val(last_name); |
|
246 |
// |
|
247 |
// var organization = sessionStorage.getItem('organization'); |
|
248 |
// if (organization !== null) $('#organization').val(organization); |
|
249 |
// |
|
250 |
// var username = sessionStorage.getItem('username'); |
|
251 |
// if (username !== null) $('#username').val(username); |
|
252 |
// |
|
253 |
// var email = sessionStorage.getItem('email'); |
|
254 |
// if (email !== null) $('#email').val(email); |
|
255 |
// |
|
256 |
// var email_conf= sessionStorage.getItem('email_conf'); |
|
257 |
// if (email_conf!== null) $('#email_conf').val(email_conf); |
|
258 |
// |
|
259 |
// |
|
260 |
// } |
|
261 |
// |
|
262 |
// // Before refreshing the page, save the form data to sessionStorage |
|
263 |
// window.onbeforeunload = function() { |
|
264 |
// sessionStorage.setItem("first_name", $('#first_name').val()); |
|
265 |
// sessionStorage.setItem("last_name", $('#last_name').val()); |
|
266 |
// sessionStorage.setItem("organization", $('#organization').val()); |
|
267 |
// sessionStorage.setItem("username", $('#username').val()); |
|
268 |
// sessionStorage.setItem("email", $('#email').val()); |
|
269 |
// sessionStorage.setItem("email_conf", $('#email_conf').val()); |
|
270 |
// } |
|
227 | 271 |
|
228 |
// // If sessionStorage is storing default values (ex. name), exit the function and do not restore data |
|
229 |
// if (sessionStorage.getItem('name') == "name") { |
|
230 |
// return; |
|
231 |
// } |
|
232 | 272 |
|
233 |
// If values are not blank, restore them to the fields |
|
234 | 273 |
|
235 |
var first_name = sessionStorage.getItem('first_name'); |
|
236 |
if (first_name !== null) $('#first_name').val(first_name); |
|
237 |
|
|
238 |
var last_name = sessionStorage.getItem('last_name'); |
|
239 |
if (last_name !== null) $('#last_name').val(last_name); |
|
240 |
|
|
241 |
var organization = sessionStorage.getItem('organization'); |
|
242 |
if (organization !== null) $('#organization').val(organization); |
|
243 |
|
|
244 |
var username = sessionStorage.getItem('username'); |
|
245 |
if (username !== null) $('#username').val(username); |
|
246 |
|
|
247 |
var email = sessionStorage.getItem('email'); |
|
248 |
if (email !== null) $('#email').val(email); |
|
249 |
|
|
250 |
var email_conf= sessionStorage.getItem('email_conf'); |
|
251 |
if (email_conf!== null) $('#email_conf').val(email_conf); |
|
252 |
|
|
253 |
|
|
254 |
} |
|
255 |
|
|
256 |
// Before refreshing the page, save the form data to sessionStorage |
|
257 |
window.onbeforeunload = function() { |
|
258 |
sessionStorage.setItem("first_name", $('#first_name').val()); |
|
259 |
sessionStorage.setItem("last_name", $('#last_name').val()); |
|
260 |
sessionStorage.setItem("organization", $('#organization').val()); |
|
261 |
sessionStorage.setItem("username", $('#username').val()); |
|
262 |
sessionStorage.setItem("email", $('#email').val()); |
|
263 |
sessionStorage.setItem("email_conf", $('#email_conf').val()); |
|
264 |
} |
|
265 |
|
|
266 |
|
|
267 |
|
|
268 | 274 |
</script> |
269 | 275 |
</div> |
270 | 276 |
</ul> |
Also available in: Unified diff
Add variables in session