Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
36b5fdd9
Commit
36b5fdd9
authored
Mar 17, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
js validation: better interactivity for inst_type according to various inst_label situations
parent
e3bda4a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
2 deletions
+27
-2
comex_page_profile_controllers.js
static/js/comex_page_profile_controllers.js
+26
-1
org_details.html
templates/questions/org_details.html
+1
-1
No files found.
static/js/comex_page_profile_controllers.js
View file @
36b5fdd9
...
...
@@ -17,7 +17,7 @@
var
teamCityDiv
=
document
.
getElementById
(
'lab_locname_div'
)
var
otherInstDiv
=
document
.
getElementById
(
'other_inst_div'
)
// TODO make relative to inst_type and move inline snippet to extended form obj
var
other
Org
TypeInput
=
document
.
getElementById
(
'other_inst_type'
)
var
other
Inst
TypeInput
=
document
.
getElementById
(
'other_inst_type'
)
// reselecting current_user's info choices
function
setupSavedItems
(
uinfo
)
{
...
...
@@ -122,6 +122,31 @@ deleteUser.checked = false
setupSavedItems
(
uinfo
)
// monitor inst label (if any), so if label changes => reset inst_type (if any)
var
instLabelInput
=
document
.
getElementById
(
'inst_label'
)
var
instTypeInput
=
document
.
getElementById
(
'inst_type'
)
var
instLabelPreviousVal
=
instLabelInput
.
value
instLabelInput
.
onblur
=
function
()
{
console
.
log
(
"hello onblur"
)
if
(
instTypeInput
.
value
)
{
if
(
instLabelPreviousVal
!=
""
&&
(
!
instLabelInput
.
value
||
(
instLabelInput
.
value
!=
instLabelPreviousVal
)))
{
// we reset all inst_type block
instTypeInput
.
value
=
''
otherInstDiv
.
style
.
display
=
'none'
;
otherInstTypeInput
.
value
=
''
;
}
}
instLabelPreviousVal
=
instLabelInput
.
value
// NB don't use uinfo because user may have already changed the form
}
instTypeInput
.
onblur
=
function
()
{
instLabelPreviousVal
=
instLabelInput
.
value
}
// open middlename if there is one
if
(
uinfo
.
middle_name
!=
null
&&
uinfo
.
middle_name
!=
""
...
...
templates/questions/org_details.html
View file @
36b5fdd9
...
...
@@ -39,7 +39,7 @@
<label
for=
"inst_type"
class=
"smlabel input-group-addon"
>
Institution Type
</label>
<select
id=
"inst_type"
name=
"inst_type"
class=
"custom-select form-control"
onchange=
"if(this.value=='other'){otherInstDiv.style.display = 'block'} else {otherInstDiv.style.display='none';other
Org
TypeInput.value=''}"
>
onchange=
"if(this.value=='other'){otherInstDiv.style.display = 'block'} else {otherInstDiv.style.display='none';other
Inst
TypeInput.value=''}"
>
<option
selected
disabled
value=
""
>
Please select
</option>
<option
value=
"university"
>
University
</option>
<option
value=
"public R&D org"
>
Public sector R
&
D organization
</option>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment