File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ var elemIds = {
29
29
match : 'match-type-select' ,
30
30
url : 'search-url' ,
31
31
form : 'search-form' ,
32
- resultsNewWindow : 'open-results-new-window'
32
+ resultsNewWindow : 'open-results-new-window' ,
33
+ advancedOptions : 'advanced-options'
33
34
} ;
34
35
35
36
function makeCheckDateRangeChecker ( dtInputId , dtBadNotice ) {
@@ -158,6 +159,13 @@ function performQuery(url) {
158
159
}
159
160
}
160
161
162
+ function validateFields ( form ) {
163
+ if ( ! didSetWasValidated ) {
164
+ form . classList . add ( 'was-validated' ) ;
165
+ didSetWasValidated = true ;
166
+ }
167
+ }
168
+
161
169
$ ( document ) . ready ( function ( ) {
162
170
$ ( '[data-toggle="tooltip"]' ) . tooltip ( {
163
171
container : 'body' ,
@@ -180,12 +188,12 @@ $(document).ready(function() {
180
188
event . stopPropagation ( ) ;
181
189
var url = searchURLInput . value ;
182
190
if ( ! url ) {
183
- if ( ! didSetWasValidated ) {
184
- form . classList . add ( 'was-validated' ) ;
185
- didSetWasValidated = true ;
186
- }
191
+ validateFields ( form ) ;
187
192
return ;
188
193
}
189
194
performQuery ( url ) ;
190
195
} ) ;
196
+ document . getElementById ( elemIds . advancedOptions ) . onclick = function ( ) {
197
+ validateFields ( form ) ;
198
+ }
191
199
} ) ;
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ <h4 class="display-4">
47
47
{% trans %}Search{% endtrans %}
48
48
</ button >
49
49
< button class ="btn btn-outline-info float-right mr-3 " type ="button " role ="button "
50
- data-toggle ="collapse " data-target ="#advancedOptions "
50
+ data-toggle ="collapse " data-target ="#advancedOptions " id =" advanced-options "
51
51
aria-expanded ="false " aria-controls ="advancedOptions " aria-label ="Advanced Search Options ">
52
52
{{ _('Advanced Search Options') }}
53
53
</ button >
You can’t perform that action at this time.
0 commit comments