Skip to content

Commit 65a93df

Browse files
committed
Clear the value for externalWebId if checkbox is not checked
1 parent 982d904 commit 65a93df

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

default-views/account/register-form.hbs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="col-md-6">
33
<div class="panel panel-default">
44
<div class="panel-body">
5-
<form method="post" action="/api/accounts/new">
5+
<form method="post" action="/api/accounts/new" id="RegisterForm">
66
{{> shared/error}}
77

88
<div class="form-group">
@@ -134,6 +134,14 @@
134134
connect.addEventListener('change', function () {
135135
container.classList.toggle('hidden', !connect.checked)
136136
})
137+
138+
var form = document.getElementById('RegisterForm')
139+
var externalWebIdField = document.getElementById('externalWebId')
140+
form.addEventListener('submit', function () {
141+
if (!connect.checked) {
142+
externalWebIdField.value = ''
143+
}
144+
})
137145
})
138146
</script>
139147

0 commit comments

Comments
 (0)